id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
67934497_1 | {
"fields": [
{
"declarator": "server = TestServer.getInstance()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TestServer server = TestServer.getInstance();",
"type": "TestServer",
"var_name": "server"
},
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandlerTest.class)",
"modifier": "static final",
"original_string": "static final Logger logger = LoggerFactory.getLogger(DataGetHandlerTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "enableHttp2 = server.getServerConfig().isEnableHttp2()",
"modifier": "static final",
"original_string": "static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();",
"type": "boolean",
"var_name": "enableHttp2"
},
{
"declarator": "enableHttps = server.getServerConfig().isEnableHttps()",
"modifier": "static final",
"original_string": "static final boolean enableHttps = server.getServerConfig().isEnableHttps();",
"type": "boolean",
"var_name": "enableHttps"
},
{
"declarator": "httpPort = server.getServerConfig().getHttpPort()",
"modifier": "static final",
"original_string": "static final int httpPort = server.getServerConfig().getHttpPort();",
"type": "int",
"var_name": "httpPort"
},
{
"declarator": "httpsPort = server.getServerConfig().getHttpsPort()",
"modifier": "static final",
"original_string": "static final int httpsPort = server.getServerConfig().getHttpsPort();",
"type": "int",
"var_name": "httpsPort"
},
{
"declarator": "url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort",
"modifier": "static final",
"original_string": "static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;",
"type": "String",
"var_name": "url"
}
],
"file": "rest/swagger/ms_chain/api_b/metrics/src/test/java/com/networknt/apib/handler/DataGetHandlerTest.java",
"identifier": "DataGetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDataGetHandlerTest() throws ClientException, ApiException {\n /*\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference<ClientResponse> reference = new AtomicReference<>();\n try {\n ClientRequest request = new ClientRequest().setPath(\"/v1/data\").setMethod(Methods.GET);\n \n connection.sendRequest(request, client.createClientCallback(reference, latch));\n \n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n int statusCode = reference.get().getResponseCode();\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Assert.assertEquals(200, statusCode);\n Assert.assertNotNull(body);\n */\n }",
"class_method_signature": "DataGetHandlerTest.testDataGetHandlerTest()",
"constructor": false,
"full_signature": "@Test public void testDataGetHandlerTest()",
"identifier": "testDataGetHandlerTest",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDataGetHandlerTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_NAME = \"api_b\"",
"modifier": "static",
"original_string": "static String CONFIG_NAME = \"api_b\";",
"type": "String",
"var_name": "CONFIG_NAME"
},
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandler.class)",
"modifier": "static",
"original_string": "static Logger logger = LoggerFactory.getLogger(DataGetHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "apicHost = (String) Config.getInstance().getJsonMapConfig(CONFIG_NAME).get(\"api_c_host\")",
"modifier": "static",
"original_string": "static String apicHost = (String) Config.getInstance().getJsonMapConfig(CONFIG_NAME).get(\"api_c_host\");",
"type": "String",
"var_name": "apicHost"
},
{
"declarator": "apicPath = (String) Config.getInstance().getJsonMapConfig(CONFIG_NAME).get(\"api_c_path\")",
"modifier": "static",
"original_string": "static String apicPath = (String) Config.getInstance().getJsonMapConfig(CONFIG_NAME).get(\"api_c_path\");",
"type": "String",
"var_name": "apicPath"
},
{
"declarator": "securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG)",
"modifier": "static",
"original_string": "static Map<String, Object> securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG);",
"type": "Map<String, Object>",
"var_name": "securityConfig"
},
{
"declarator": "securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT)",
"modifier": "static",
"original_string": "static boolean securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT);",
"type": "boolean",
"var_name": "securityEnabled"
},
{
"declarator": "client = Http2Client.getInstance()",
"modifier": "static",
"original_string": "static Http2Client client = Http2Client.getInstance();",
"type": "Http2Client",
"var_name": "client"
},
{
"declarator": "connection",
"modifier": "static",
"original_string": "static ClientConnection connection;",
"type": "ClientConnection",
"var_name": "connection"
}
],
"file": "rest/swagger/ms_chain/api_b/metrics/src/main/java/com/networknt/apib/handler/DataGetHandler.java",
"identifier": "DataGetHandler",
"interfaces": "implements HttpHandler",
"methods": [
{
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
},
{
"class_method_signature": "DataGetHandler.handleRequest(HttpServerExchange exchange)",
"constructor": false,
"full_signature": "@Override public void handleRequest(HttpServerExchange exchange)",
"identifier": "handleRequest",
"modifiers": "@Override public",
"parameters": "(HttpServerExchange exchange)",
"return": "void",
"signature": "void handleRequest(HttpServerExchange exchange)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public DataGetHandler() {\n try {\n connection = client.connect(new URI(apicHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n } catch (Exception e) {\n logger.error(\"Exeption:\", e);\n }\n }",
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
67934497_45 | {
"fields": [
{
"declarator": "server = TestServer.getInstance()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TestServer server = TestServer.getInstance();",
"type": "TestServer",
"var_name": "server"
},
{
"declarator": "logger = LoggerFactory.getLogger(PetsPetIdGetHandlerTest.class)",
"modifier": "static final",
"original_string": "static final Logger logger = LoggerFactory.getLogger(PetsPetIdGetHandlerTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "enableHttp2 = server.getServerConfig().isEnableHttp2()",
"modifier": "static final",
"original_string": "static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();",
"type": "boolean",
"var_name": "enableHttp2"
},
{
"declarator": "enableHttps = server.getServerConfig().isEnableHttps()",
"modifier": "static final",
"original_string": "static final boolean enableHttps = server.getServerConfig().isEnableHttps();",
"type": "boolean",
"var_name": "enableHttps"
},
{
"declarator": "httpPort = server.getServerConfig().getHttpPort()",
"modifier": "static final",
"original_string": "static final int httpPort = server.getServerConfig().getHttpPort();",
"type": "int",
"var_name": "httpPort"
},
{
"declarator": "httpsPort = server.getServerConfig().getHttpsPort()",
"modifier": "static final",
"original_string": "static final int httpsPort = server.getServerConfig().getHttpsPort();",
"type": "int",
"var_name": "httpsPort"
},
{
"declarator": "url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort",
"modifier": "static final",
"original_string": "static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;",
"type": "String",
"var_name": "url"
}
],
"file": "middleware-performance/endpoint-source/src/test/java/com/networknt/petstore/handler/PetsPetIdGetHandlerTest.java",
"identifier": "PetsPetIdGetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPetsPetIdGetHandlerTest() throws ClientException, ApiException {\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference<ClientResponse> reference = new AtomicReference<>();\n try {\n ClientRequest request = new ClientRequest().setPath(\"/v1/pets/111\").setMethod(Methods.GET);\n \n connection.sendRequest(request, client.createClientCallback(reference, latch));\n \n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n int statusCode = reference.get().getResponseCode();\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Assert.assertEquals(200, statusCode);\n Assert.assertNotNull(body);\n }",
"class_method_signature": "PetsPetIdGetHandlerTest.testPetsPetIdGetHandlerTest()",
"constructor": false,
"full_signature": "@Test public void testPetsPetIdGetHandlerTest()",
"identifier": "testPetsPetIdGetHandlerTest",
"invocations": [
"getInstance",
"get",
"connect",
"create",
"setMethod",
"setPath",
"sendRequest",
"createClientCallback",
"await",
"error",
"safeClose",
"getResponseCode",
"get",
"getAttachment",
"get",
"assertEquals",
"assertNotNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPetsPetIdGetHandlerTest()",
"testcase": true
} | {
"fields": [],
"file": "middleware-performance/endpoint-source/src/main/java/com/networknt/petstore/handler/PetsPetIdGetHandler.java",
"identifier": "PetsPetIdGetHandler",
"interfaces": "implements LightHttpHandler",
"methods": [
{
"class_method_signature": "PetsPetIdGetHandler.PetsPetIdGetHandler()",
"constructor": true,
"full_signature": "public PetsPetIdGetHandler()",
"identifier": "PetsPetIdGetHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PetsPetIdGetHandler()",
"testcase": false
},
{
"class_method_signature": "PetsPetIdGetHandler.handleRequest(HttpServerExchange exchange)",
"constructor": false,
"full_signature": "@Override public void handleRequest(HttpServerExchange exchange)",
"identifier": "handleRequest",
"modifiers": "@Override public",
"parameters": "(HttpServerExchange exchange)",
"return": "void",
"signature": "void handleRequest(HttpServerExchange exchange)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public PetsPetIdGetHandler() {\n System.out.println(\"*********************Constructor is called.\");\n }",
"class_method_signature": "PetsPetIdGetHandler.PetsPetIdGetHandler()",
"constructor": true,
"full_signature": "public PetsPetIdGetHandler()",
"identifier": "PetsPetIdGetHandler",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PetsPetIdGetHandler()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
67934497_44 | {
"fields": [
{
"declarator": "ds",
"modifier": "public static",
"original_string": "public static DataSource ds;",
"type": "DataSource",
"var_name": "ds"
},
{
"declarator": "customerRepository = (CustomerViewRepository) SingletonServiceFactory.getBean(CustomerViewRepository.class)",
"modifier": "private",
"original_string": "private CustomerViewRepository customerRepository = (CustomerViewRepository) SingletonServiceFactory.getBean(CustomerViewRepository.class);",
"type": "CustomerViewRepository",
"var_name": "customerRepository"
},
{
"declarator": "customer",
"modifier": "private static",
"original_string": "private static QuerySideCustomer customer;",
"type": "QuerySideCustomer",
"var_name": "customer"
},
{
"declarator": "id",
"modifier": "private static",
"original_string": "private static String id;",
"type": "String",
"var_name": "id"
}
],
"file": "eventuate/account-management/query/src/test/java/com/networknt/eventuate/queryservice/customer/CustomerViewRepositoryImplTest.java",
"identifier": "CustomerViewRepositoryImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFindByEmail() {\n List<QuerySideCustomer> result = customerRepository.findByEmailLike(\"%aaa%\");\n assertNotNull(result);\n // System.out.println(\"customer name:\" + result.get(0).getName().getFirstName());\n\n }",
"class_method_signature": "CustomerViewRepositoryImplTest.testFindByEmail()",
"constructor": false,
"full_signature": "@Test public void testFindByEmail()",
"identifier": "testFindByEmail",
"invocations": [
"findByEmailLike",
"assertNotNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testFindByEmail()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "protected",
"original_string": "protected Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "dataSource",
"modifier": "private",
"original_string": "private DataSource dataSource;",
"type": "DataSource",
"var_name": "dataSource"
}
],
"file": "eventuate/account-management/query/src/main/java/com/networknt/eventuate/queryservice/customer/CustomerViewRepositoryImpl.java",
"identifier": "CustomerViewRepositoryImpl",
"interfaces": "implements CustomerViewRepository",
"methods": [
{
"class_method_signature": "CustomerViewRepositoryImpl.CustomerViewRepositoryImpl(DataSource dataSource)",
"constructor": true,
"full_signature": "public CustomerViewRepositoryImpl(DataSource dataSource)",
"identifier": "CustomerViewRepositoryImpl",
"modifiers": "public",
"parameters": "(DataSource dataSource)",
"return": "",
"signature": " CustomerViewRepositoryImpl(DataSource dataSource)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.setDataSource(DataSource dataSource)",
"constructor": false,
"full_signature": "public void setDataSource(DataSource dataSource)",
"identifier": "setDataSource",
"modifiers": "public",
"parameters": "(DataSource dataSource)",
"return": "void",
"signature": "void setDataSource(DataSource dataSource)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.findByEmailLike(String email)",
"constructor": false,
"full_signature": "public List<QuerySideCustomer> findByEmailLike(String email)",
"identifier": "findByEmailLike",
"modifiers": "public",
"parameters": "(String email)",
"return": "List<QuerySideCustomer>",
"signature": "List<QuerySideCustomer> findByEmailLike(String email)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.findOneCustomer(String customerId)",
"constructor": false,
"full_signature": "public QuerySideCustomer findOneCustomer(String customerId)",
"identifier": "findOneCustomer",
"modifiers": "public",
"parameters": "(String customerId)",
"return": "QuerySideCustomer",
"signature": "QuerySideCustomer findOneCustomer(String customerId)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.save(QuerySideCustomer customer)",
"constructor": false,
"full_signature": "public void save(QuerySideCustomer customer)",
"identifier": "save",
"modifiers": "public",
"parameters": "(QuerySideCustomer customer)",
"return": "void",
"signature": "void save(QuerySideCustomer customer)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.addToAccount(String id, ToAccountInfo accountInfo)",
"constructor": false,
"full_signature": "public int addToAccount(String id, ToAccountInfo accountInfo)",
"identifier": "addToAccount",
"modifiers": "public",
"parameters": "(String id, ToAccountInfo accountInfo)",
"return": "int",
"signature": "int addToAccount(String id, ToAccountInfo accountInfo)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.deleteToAccount(String id, String accountId)",
"constructor": false,
"full_signature": "public void deleteToAccount(String id, String accountId)",
"identifier": "deleteToAccount",
"modifiers": "public",
"parameters": "(String id, String accountId)",
"return": "void",
"signature": "void deleteToAccount(String id, String accountId)",
"testcase": false
},
{
"class_method_signature": "CustomerViewRepositoryImpl.deleteToAccountFromAllCustomers(String accountId)",
"constructor": false,
"full_signature": "public void deleteToAccountFromAllCustomers(String accountId)",
"identifier": "deleteToAccountFromAllCustomers",
"modifiers": "public",
"parameters": "(String accountId)",
"return": "void",
"signature": "void deleteToAccountFromAllCustomers(String accountId)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<QuerySideCustomer> findByEmailLike(String email){\n\n Objects.requireNonNull(email);\n String psSelect = \"SELECT c.customer_Id,first_name, last_name, email, password, ssn, phoneNumber, street1, street2, city, state, country, zipCode \" +\n \"FROM customer c join address a ON a.customer_Id =c.customer_Id \" +\n \" WHERE ACTIVE_FLG = 'Y' AND email LIKE ?\";\n List<QuerySideCustomer> customers = new ArrayList<QuerySideCustomer>();\n try (final Connection connection = dataSource.getConnection()){\n PreparedStatement stmt = connection.prepareStatement(psSelect);\n stmt.setString(1, \"%\" + email + \"%\");\n ResultSet rs = stmt.executeQuery();\n\n while (rs.next()) {\n QuerySideCustomer customer = new QuerySideCustomer();\n customer.setId(rs.getString(\"customer_Id\"));\n Name name= new Name(rs.getString(\"first_name\"), rs.getString(\"last_name\"));\n customer.setName(name);\n customer.setEmail(rs.getString(\"email\"));\n customer.setPassword(rs.getString(\"password\"));\n customer.setSsn(rs.getString(\"ssn\"));\n customer.setPhoneNumber(rs.getString(\"phoneNumber\"));\n Address address = new Address(rs.getString(\"street1\"), rs.getString(\"street2\"), rs.getString(\"city\"),\n rs.getString(\"state\"), rs.getString(\"zipCode\"),rs.getString(\"country\"));\n customer.setAddress(address);\n customers.add(customer);\n }\n } catch (SQLException e) {\n logger.error(\"SqlException:\", e);\n }\n\n\n return customers;\n }",
"class_method_signature": "CustomerViewRepositoryImpl.findByEmailLike(String email)",
"constructor": false,
"full_signature": "public List<QuerySideCustomer> findByEmailLike(String email)",
"identifier": "findByEmailLike",
"invocations": [
"requireNonNull",
"getConnection",
"prepareStatement",
"setString",
"executeQuery",
"next",
"setId",
"getString",
"getString",
"getString",
"setName",
"setEmail",
"getString",
"setPassword",
"getString",
"setSsn",
"getString",
"setPhoneNumber",
"getString",
"getString",
"getString",
"getString",
"getString",
"getString",
"getString",
"setAddress",
"add",
"error"
],
"modifiers": "public",
"parameters": "(String email)",
"return": "List<QuerySideCustomer>",
"signature": "List<QuerySideCustomer> findByEmailLike(String email)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
67934497_13 | {
"fields": [
{
"declarator": "server = TestServer.getInstance()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TestServer server = TestServer.getInstance();",
"type": "TestServer",
"var_name": "server"
},
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandlerTest.class)",
"modifier": "static final",
"original_string": "static final Logger logger = LoggerFactory.getLogger(DataGetHandlerTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "enableHttp2 = server.getServerConfig().isEnableHttp2()",
"modifier": "static final",
"original_string": "static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();",
"type": "boolean",
"var_name": "enableHttp2"
},
{
"declarator": "enableHttps = server.getServerConfig().isEnableHttps()",
"modifier": "static final",
"original_string": "static final boolean enableHttps = server.getServerConfig().isEnableHttps();",
"type": "boolean",
"var_name": "enableHttps"
},
{
"declarator": "httpPort = server.getServerConfig().getHttpPort()",
"modifier": "static final",
"original_string": "static final int httpPort = server.getServerConfig().getHttpPort();",
"type": "int",
"var_name": "httpPort"
},
{
"declarator": "httpsPort = server.getServerConfig().getHttpsPort()",
"modifier": "static final",
"original_string": "static final int httpsPort = server.getServerConfig().getHttpsPort();",
"type": "int",
"var_name": "httpsPort"
},
{
"declarator": "url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort",
"modifier": "static final",
"original_string": "static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;",
"type": "String",
"var_name": "url"
},
{
"declarator": "JSON_MEDIA_TYPE = \"application/json\"",
"modifier": "static final",
"original_string": "static final String JSON_MEDIA_TYPE = \"application/json\";",
"type": "String",
"var_name": "JSON_MEDIA_TYPE"
}
],
"file": "discovery/api_b/consuldocker/src/test/java/com/networknt/ab/handler/DataGetHandlerTest.java",
"identifier": "DataGetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDataGetHandlerTest() throws ClientException {\n\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference<ClientResponse> reference = new AtomicReference<>();\n String requestUri = \"/v1/data\";\n String httpMethod = \"get\";\n try {\n ClientRequest request = new ClientRequest().setPath(requestUri).setMethod(Methods.GET);\n \n //customized header parameters \n connection.sendRequest(request, client.createClientCallback(reference, latch));\n \n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Optional<HeaderValues> contentTypeName = Optional.ofNullable(reference.get().getResponseHeaders().get(Headers.CONTENT_TYPE));\n SchemaValidatorsConfig config = new SchemaValidatorsConfig();\n ResponseValidator responseValidator = new ResponseValidator(config);\n int statusCode = reference.get().getResponseCode();\n Status status;\n if(contentTypeName.isPresent()) {\n status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), contentTypeName.get().getFirst());\n } else {\n status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), JSON_MEDIA_TYPE);\n }\n Assert.assertNull(status);\n }",
"class_method_signature": "DataGetHandlerTest.testDataGetHandlerTest()",
"constructor": false,
"full_signature": "@Test public void testDataGetHandlerTest()",
"identifier": "testDataGetHandlerTest",
"invocations": [
"getInstance",
"get",
"connect",
"create",
"setMethod",
"setPath",
"sendRequest",
"createClientCallback",
"await",
"error",
"safeClose",
"getAttachment",
"get",
"ofNullable",
"get",
"getResponseHeaders",
"get",
"getResponseCode",
"get",
"isPresent",
"validateResponseContent",
"valueOf",
"getFirst",
"get",
"validateResponseContent",
"valueOf",
"assertNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDataGetHandlerTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandler.class)",
"modifier": "static",
"original_string": "static Logger logger = LoggerFactory.getLogger(DataGetHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "cluster = SingletonServiceFactory.getBean(Cluster.class)",
"modifier": "static",
"original_string": "static Cluster cluster = SingletonServiceFactory.getBean(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "apidHost",
"modifier": "static",
"original_string": "static String apidHost;",
"type": "String",
"var_name": "apidHost"
},
{
"declarator": "path = \"/v1/data\"",
"modifier": "static",
"original_string": "static String path = \"/v1/data\";",
"type": "String",
"var_name": "path"
},
{
"declarator": "securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG)",
"modifier": "static",
"original_string": "static Map<String, Object> securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG);",
"type": "Map<String, Object>",
"var_name": "securityConfig"
},
{
"declarator": "securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT)",
"modifier": "static",
"original_string": "static boolean securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT);",
"type": "boolean",
"var_name": "securityEnabled"
},
{
"declarator": "tag = Server.getServerConfig().getEnvironment()",
"modifier": "static",
"original_string": "static String tag = Server.getServerConfig().getEnvironment();",
"type": "String",
"var_name": "tag"
},
{
"declarator": "client = Http2Client.getInstance()",
"modifier": "static",
"original_string": "static Http2Client client = Http2Client.getInstance();",
"type": "Http2Client",
"var_name": "client"
}
],
"file": "discovery/api_b/consuldocker/src/main/java/com/networknt/ab/handler/DataGetHandler.java",
"identifier": "DataGetHandler",
"interfaces": "implements LightHttpHandler",
"methods": [
{
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
},
{
"class_method_signature": "DataGetHandler.handleRequest(HttpServerExchange exchange)",
"constructor": false,
"full_signature": "@Override public void handleRequest(HttpServerExchange exchange)",
"identifier": "handleRequest",
"modifiers": "@Override public",
"parameters": "(HttpServerExchange exchange)",
"return": "void",
"signature": "void handleRequest(HttpServerExchange exchange)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public DataGetHandler() {\n }",
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
67934497_0 | {
"fields": [
{
"declarator": "server = TestServer.getInstance()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TestServer server = TestServer.getInstance();",
"type": "TestServer",
"var_name": "server"
},
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandlerTest.class)",
"modifier": "static final",
"original_string": "static final Logger logger = LoggerFactory.getLogger(DataGetHandlerTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "enableHttp2 = server.getServerConfig().isEnableHttp2()",
"modifier": "static final",
"original_string": "static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();",
"type": "boolean",
"var_name": "enableHttp2"
},
{
"declarator": "enableHttps = server.getServerConfig().isEnableHttps()",
"modifier": "static final",
"original_string": "static final boolean enableHttps = server.getServerConfig().isEnableHttps();",
"type": "boolean",
"var_name": "enableHttps"
},
{
"declarator": "httpPort = server.getServerConfig().getHttpPort()",
"modifier": "static final",
"original_string": "static final int httpPort = server.getServerConfig().getHttpPort();",
"type": "int",
"var_name": "httpPort"
},
{
"declarator": "httpsPort = server.getServerConfig().getHttpsPort()",
"modifier": "static final",
"original_string": "static final int httpsPort = server.getServerConfig().getHttpsPort();",
"type": "int",
"var_name": "httpsPort"
},
{
"declarator": "url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort",
"modifier": "static final",
"original_string": "static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;",
"type": "String",
"var_name": "url"
}
],
"file": "rest/openapi/ms-aggregate/aa/https/src/test/java/com/networknt/aa/handler/DataGetHandlerTest.java",
"identifier": "DataGetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDataGetHandlerTest() throws ClientException, ApiException {\n /*\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference<ClientResponse> reference = new AtomicReference<>();\n try {\n ClientRequest request = new ClientRequest().setPath(\"/v1/data\").setMethod(Methods.GET);\n \n connection.sendRequest(request, client.createClientCallback(reference, latch));\n \n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n int statusCode = reference.get().getResponseCode();\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Assert.assertEquals(200, statusCode);\n Assert.assertNotNull(body);\n */\n }",
"class_method_signature": "DataGetHandlerTest.testDataGetHandlerTest()",
"constructor": false,
"full_signature": "@Test public void testDataGetHandlerTest()",
"identifier": "testDataGetHandlerTest",
"invocations": [],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDataGetHandlerTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandler.class)",
"modifier": "static",
"original_string": "static Logger logger = LoggerFactory.getLogger(DataGetHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "cluster = SingletonServiceFactory.getBean(Cluster.class)",
"modifier": "static",
"original_string": "static Cluster cluster = SingletonServiceFactory.getBean(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "abHost",
"modifier": "static",
"original_string": "static String abHost;",
"type": "String",
"var_name": "abHost"
},
{
"declarator": "acHost",
"modifier": "static",
"original_string": "static String acHost;",
"type": "String",
"var_name": "acHost"
},
{
"declarator": "adHost",
"modifier": "static",
"original_string": "static String adHost;",
"type": "String",
"var_name": "adHost"
},
{
"declarator": "path = \"/v1/data\"",
"modifier": "static",
"original_string": "static String path = \"/v1/data\";",
"type": "String",
"var_name": "path"
},
{
"declarator": "securityConfig = (Map) Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG)",
"modifier": "static",
"original_string": "static Map<String, Object> securityConfig = (Map) Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG);",
"type": "Map<String, Object>",
"var_name": "securityConfig"
},
{
"declarator": "securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT)",
"modifier": "static",
"original_string": "static boolean securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT);",
"type": "boolean",
"var_name": "securityEnabled"
},
{
"declarator": "client = Http2Client.getInstance()",
"modifier": "static",
"original_string": "static Http2Client client = Http2Client.getInstance();",
"type": "Http2Client",
"var_name": "client"
},
{
"declarator": "connectionAb",
"modifier": "static",
"original_string": "static ClientConnection connectionAb;",
"type": "ClientConnection",
"var_name": "connectionAb"
},
{
"declarator": "connectionAc",
"modifier": "static",
"original_string": "static ClientConnection connectionAc;",
"type": "ClientConnection",
"var_name": "connectionAc"
},
{
"declarator": "connectionAd",
"modifier": "static",
"original_string": "static ClientConnection connectionAd;",
"type": "ClientConnection",
"var_name": "connectionAd"
}
],
"file": "rest/openapi/ms-aggregate/aa/https/src/main/java/com/networknt/aa/handler/DataGetHandler.java",
"identifier": "DataGetHandler",
"interfaces": "implements HttpHandler",
"methods": [
{
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
},
{
"class_method_signature": "DataGetHandler.handleRequest(HttpServerExchange exchange)",
"constructor": false,
"full_signature": "@Override public void handleRequest(HttpServerExchange exchange)",
"identifier": "handleRequest",
"modifiers": "@Override public",
"parameters": "(HttpServerExchange exchange)",
"return": "void",
"signature": "void handleRequest(HttpServerExchange exchange)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public DataGetHandler() {\n try {\n abHost = cluster.serviceToUrl(\"https\", \"com.networknt.ab-1.0.0\", null, null);\n acHost = cluster.serviceToUrl(\"https\", \"com.networknt.ac-1.0.0\", null, null);\n adHost = cluster.serviceToUrl(\"https\", \"com.networknt.ad-1.0.0\", null, null);\n connectionAb = client.connect(new URI(abHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n connectionAc = client.connect(new URI(acHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n connectionAd = client.connect(new URI(adHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n } catch (Exception e) {\n logger.error(\"Exeption:\", e);\n }\n }",
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
67934497_25 | {
"fields": [
{
"declarator": "server = TestServer.getInstance()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TestServer server = TestServer.getInstance();",
"type": "TestServer",
"var_name": "server"
},
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandlerTest.class)",
"modifier": "static final",
"original_string": "static final Logger logger = LoggerFactory.getLogger(DataGetHandlerTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "enableHttp2 = server.getServerConfig().isEnableHttp2()",
"modifier": "static final",
"original_string": "static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();",
"type": "boolean",
"var_name": "enableHttp2"
},
{
"declarator": "enableHttps = server.getServerConfig().isEnableHttps()",
"modifier": "static final",
"original_string": "static final boolean enableHttps = server.getServerConfig().isEnableHttps();",
"type": "boolean",
"var_name": "enableHttps"
},
{
"declarator": "httpPort = server.getServerConfig().getHttpPort()",
"modifier": "static final",
"original_string": "static final int httpPort = server.getServerConfig().getHttpPort();",
"type": "int",
"var_name": "httpPort"
},
{
"declarator": "httpsPort = server.getServerConfig().getHttpsPort()",
"modifier": "static final",
"original_string": "static final int httpsPort = server.getServerConfig().getHttpsPort();",
"type": "int",
"var_name": "httpsPort"
},
{
"declarator": "url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort",
"modifier": "static final",
"original_string": "static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;",
"type": "String",
"var_name": "url"
},
{
"declarator": "JSON_MEDIA_TYPE = \"application/json\"",
"modifier": "static final",
"original_string": "static final String JSON_MEDIA_TYPE = \"application/json\";",
"type": "String",
"var_name": "JSON_MEDIA_TYPE"
}
],
"file": "discovery/api_a/consuldocker/src/test/java/com/networknt/aa/handler/DataGetHandlerTest.java",
"identifier": "DataGetHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDataGetHandlerTest() throws ClientException {\n\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference<ClientResponse> reference = new AtomicReference<>();\n String requestUri = \"/v1/data\";\n String httpMethod = \"get\";\n try {\n ClientRequest request = new ClientRequest().setPath(requestUri).setMethod(Methods.GET);\n \n //customized header parameters \n connection.sendRequest(request, client.createClientCallback(reference, latch));\n \n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Optional<HeaderValues> contentTypeName = Optional.ofNullable(reference.get().getResponseHeaders().get(Headers.CONTENT_TYPE));\n SchemaValidatorsConfig config = new SchemaValidatorsConfig();\n ResponseValidator responseValidator = new ResponseValidator(config);\n int statusCode = reference.get().getResponseCode();\n Status status;\n if(contentTypeName.isPresent()) {\n status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), contentTypeName.get().getFirst());\n } else {\n status = responseValidator.validateResponseContent(body, requestUri, httpMethod, String.valueOf(statusCode), JSON_MEDIA_TYPE);\n }\n Assert.assertNull(status);\n }",
"class_method_signature": "DataGetHandlerTest.testDataGetHandlerTest()",
"constructor": false,
"full_signature": "@Test public void testDataGetHandlerTest()",
"identifier": "testDataGetHandlerTest",
"invocations": [
"getInstance",
"get",
"connect",
"create",
"setMethod",
"setPath",
"sendRequest",
"createClientCallback",
"await",
"error",
"safeClose",
"getAttachment",
"get",
"ofNullable",
"get",
"getResponseHeaders",
"get",
"getResponseCode",
"get",
"isPresent",
"validateResponseContent",
"valueOf",
"getFirst",
"get",
"validateResponseContent",
"valueOf",
"assertNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDataGetHandlerTest()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DataGetHandler.class)",
"modifier": "static",
"original_string": "static Logger logger = LoggerFactory.getLogger(DataGetHandler.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "cluster = SingletonServiceFactory.getBean(Cluster.class)",
"modifier": "static",
"original_string": "static Cluster cluster = SingletonServiceFactory.getBean(Cluster.class);",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "apibHost",
"modifier": "static",
"original_string": "static String apibHost;",
"type": "String",
"var_name": "apibHost"
},
{
"declarator": "apicHost",
"modifier": "static",
"original_string": "static String apicHost;",
"type": "String",
"var_name": "apicHost"
},
{
"declarator": "path = \"/v1/data\"",
"modifier": "static",
"original_string": "static String path = \"/v1/data\";",
"type": "String",
"var_name": "path"
},
{
"declarator": "securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG)",
"modifier": "static",
"original_string": "static Map<String, Object> securityConfig = (Map)Config.getInstance().getJsonMapConfig(JwtVerifier.SECURITY_CONFIG);",
"type": "Map<String, Object>",
"var_name": "securityConfig"
},
{
"declarator": "securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT)",
"modifier": "static",
"original_string": "static boolean securityEnabled = (Boolean)securityConfig.get(JwtVerifier.ENABLE_VERIFY_JWT);",
"type": "boolean",
"var_name": "securityEnabled"
},
{
"declarator": "tag = Server.getServerConfig().getEnvironment()",
"modifier": "static",
"original_string": "static String tag = Server.getServerConfig().getEnvironment();",
"type": "String",
"var_name": "tag"
},
{
"declarator": "client = Http2Client.getInstance()",
"modifier": "static",
"original_string": "static Http2Client client = Http2Client.getInstance();",
"type": "Http2Client",
"var_name": "client"
},
{
"declarator": "connectionB",
"modifier": "static",
"original_string": "static ClientConnection connectionB;",
"type": "ClientConnection",
"var_name": "connectionB"
},
{
"declarator": "connectionC",
"modifier": "static",
"original_string": "static ClientConnection connectionC;",
"type": "ClientConnection",
"var_name": "connectionC"
}
],
"file": "discovery/api_a/consuldocker/src/main/java/com/networknt/aa/handler/DataGetHandler.java",
"identifier": "DataGetHandler",
"interfaces": "implements LightHttpHandler",
"methods": [
{
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
},
{
"class_method_signature": "DataGetHandler.handleRequest(HttpServerExchange exchange)",
"constructor": false,
"full_signature": "@Override public void handleRequest(HttpServerExchange exchange)",
"identifier": "handleRequest",
"modifiers": "@Override public",
"parameters": "(HttpServerExchange exchange)",
"return": "void",
"signature": "void handleRequest(HttpServerExchange exchange)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public DataGetHandler() {\n try {\n apibHost = cluster.serviceToUrl(\"https\", \"com.networknt.ab-1.0.0\", tag, null);\n apicHost = cluster.serviceToUrl(\"https\", \"com.networknt.ac-1.0.0\", tag, null);\n connectionB = client.connect(new URI(apibHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n connectionC = client.connect(new URI(apicHost), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, OptionMap.create(UndertowOptions.ENABLE_HTTP2, true)).get();\n } catch (Exception e) {\n logger.error(\"Exeption:\", e);\n }\n }",
"class_method_signature": "DataGetHandler.DataGetHandler()",
"constructor": true,
"full_signature": "public DataGetHandler()",
"identifier": "DataGetHandler",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DataGetHandler()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 59,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 67934497,
"size": 5724,
"stargazer_count": 130,
"stars": null,
"updates": null,
"url": "https://github.com/networknt/light-example-4j"
} |
23831132_16 | {
"fields": [
{
"declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())",
"modifier": "static final",
"original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());",
"type": "IteratorWithPrevious<String>",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\"",
"modifier": "final static",
"original_string": "final static String TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\";",
"type": "String",
"var_name": "TEST_PARSE_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/PipelineScriptParserTest.java",
"identifier": "PipelineScriptParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseParams() throws Exception {\n Pair<List<Object>, String> params = PipelineScriptParser\n .parseParams(new IteratorWithPrevious<String>(\n newArrayList(\" a: bla\")));\n assertEquals(2, params.getKey().size());\n assertEquals(\"xml works\", \"<a>bla</a>\", params.getValue());\n }",
"class_method_signature": "PipelineScriptParserTest.testParseParams()",
"constructor": false,
"full_signature": "@Test public void testParseParams()",
"identifier": "testParseParams",
"invocations": [
"parseParams",
"newArrayList",
"assertEquals",
"size",
"getKey",
"assertEquals",
"getValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseParams()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(PipelineScriptParser.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java",
"identifier": "PipelineScriptParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"constructor": false,
"full_signature": "private static Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"identifier": "parseAndDispatch",
"modifiers": "private static",
"parameters": "(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseMaxErrors(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseMaxErrors(String current, Pipeline pipeline)",
"identifier": "parseMaxErrors",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseMaxErrors(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseThreads(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseThreads(String current, Pipeline pipeline)",
"identifier": "parseThreads",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseThreads(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parsePython",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseJava",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"constructor": false,
"full_signature": "private static void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"identifier": "parseInclude",
"modifiers": "private static",
"parameters": "(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"return": "void",
"signature": "void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"identifier": "parseAEJava",
"modifiers": "private static",
"parameters": "(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"return": "void",
"signature": "void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") private static void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseCR",
"modifiers": "@SuppressWarnings(\"unchecked\") private static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.validateParams(List<Object> params, Class<?> classz)",
"constructor": false,
"full_signature": "private static void validateParams(List<Object> params, Class<?> classz)",
"identifier": "validateParams",
"modifiers": "private static",
"parameters": "(List<Object> params, Class<?> classz)",
"return": "void",
"signature": "void validateParams(List<Object> params, Class<?> classz)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseNextLines(IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "private static String parseNextLines(IteratorWithPrevious<String> it)",
"identifier": "parseNextLines",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it)",
"return": "String",
"signature": "String parseNextLines(IteratorWithPrevious<String> it)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it) throws ParseException {\n List<Object> params = new ArrayList<Object>();\n String xml = \"\";\n while (it.hasNext()) {\n String current = it.next();\n if (StringUtils.isBlank(current)) // end of parameters\n break;\n if (current.startsWith(\" #\")) // skip comments\n continue;\n if (!current.startsWith(\" \")) {\n it.previous(); // end of parameters\n break;\n }\n\n int split = current.indexOf(\": \");\n if (split == -1) {\n throw new ParseException(\n \"incorrect parameter line, should have a key, followed by a column, followed by a space, followed by a value: '\"\n + current + \"'\", -1);\n }\n String key = current.substring(0, split).trim();\n String valueStr = current.substring(split + 1).trim();\n xml += \"<\" + key + \">\" + escapeXml(valueStr) + \"</\" + key + \">\";\n\n Object value = null;\n if (key.endsWith(\"__java\")) { // interpret as java code\n Interpreter i = new Interpreter();\n key = key.substring(0, key.length() - 6);\n try {\n i.eval(\"value = \" + valueStr + \";\");\n value = i.get(\"value\");\n } catch (Exception e) {\n throw new ParseException(\n \"cannot compile and run '__java' parameter with value '\"\n + valueStr + \"', error:\" + e.toString(), -1);\n }\n } else { // a string\n\n // check if multiline\n if (valueStr.endsWith(\"\\\\\")) {\n value = valueStr.substring(0, valueStr.length() - 1) // rm \\\n + \" \" + parseNextLines(it);\n } else {\n value = valueStr;\n }\n }\n LOG.info(\" +-param. {}=>{}\", key, value);\n\n params.add(key);\n params.add(value);\n }\n return new Pair<List<Object>, String>(params, xml);\n }",
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"invocations": [
"hasNext",
"next",
"isBlank",
"startsWith",
"startsWith",
"previous",
"indexOf",
"trim",
"substring",
"trim",
"substring",
"escapeXml",
"endsWith",
"substring",
"length",
"eval",
"get",
"toString",
"endsWith",
"substring",
"length",
"parseNextLines",
"info",
"add",
"add"
],
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_100 | {
"fields": [],
"file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java",
"identifier": "PubmedSearchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPmidArticle() throws Exception {\n List<PubmedArticleType> articles = newArrayList(new PubmedSearch()\n .search(\"23447503[pmid]\"));\n assertTrue(articles.size() == 1);\n assertEquals(\"23447503\", articles.get(0).getMedlineCitation().getPMID()\n .toString());\n // String q =\n // \" 23447502 23447501 23447500 23447499 23447498 23447497 23447496 23447495 23447494 23447493 23447492 23447491 23447490 23447489 23447488 23447487 23447486 23447485 23447484 23447483 23447482 23447481 23447480 23447479 23447478 23447477 23447476 23447475 23447474 23447473 23447472 23447471 23447470 23447469 23447468 23447467 23447466 23447465 23447464 23447463 23447462 23447461 23447460 23447459 23447458 23447457 23447456 23447455 23447454 23447453 23447452 23447451 23447450 23447449 23447448 23447447 23447446 23447445 23447444 23447443 23447442 23447441 23447440 23447439 23447438 23447437 23447436 23447435 23447434 23447433 23447432 23447431 23447430 23447429 23447428 23447427 23447426 23447425 23447424 23447423 23447422 23447421 23447420 23447419 23447418 23447417 23447416 23447415 23447414 23447413 23447412 23447410 23447409 23447408 23447407 23447406 23447405 23447404 23447403 23447402 23447401 23447400 23447399 23447398 23447397 23447396 23447395 23447394 23447393 23447392 23447391 23447390 23447389 23447388 23447387 23447386 23447385 23447384 23447383 23447382 23447381 23447380 23447379 23447378 23447377 23447376 23447375 23447374 23447373 23447372 23447371 23447370 23447369 23447368 23447367 23447366 23447365 23447364 23447363 23447362 23447361 23447360 23447359 23447358 23447357 23447356 23447355 23447354 23447353 23447352 23447351 23447350 23447349 23447348 23447347 23447346 23447345 23447344 23447343 23447342 23447341 23447340 23447339 23447338 23447337 23447336 23447335 23447334 23447333 23447332 23447331 23447145 23447144 23447143 23447142 23447141 23447140 23447139 23447138 23447137 23447136 23447135 23447134 23447133 23447132 23447131 23447130 23447129 23447128 23447127 23447126 23447125 23447124 23447123 23447122 23447121 23447120 23447119 23447118 23447117 23447116 23447115 23447114 23447113 23447112 23447111 23447110 23447109 23447108 23447107 23447106 23447105 23447104 23447103 23447102 23447101 23447100 23447099 23447098 23447097 23447096 23447095 23447094 23447093 23447092 23447091 23447090 23447089 23447088 23447087 23447086 23447085 23447084 23447083 23447082 23447081 23447080 23447079 23447078 23447077 23447076 23447075 23447074 23447073 23447072 23447071 23447070 23447069 23447068 23447067 \";\n // articles = newArrayList(new PubmedSearch()\n // .search(q+\"[pmid]\"));\n // assertEquals(250,articles.size());\n\n }",
"class_method_signature": "PubmedSearchTest.testPmidArticle()",
"constructor": false,
"full_signature": "@Test public void testPmidArticle()",
"identifier": "testPmidArticle",
"invocations": [
"newArrayList",
"search",
"assertTrue",
"size",
"assertEquals",
"toString",
"getPMID",
"getMedlineCitation",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPmidArticle()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "service",
"modifier": "private",
"original_string": "private EUtilsServiceStub service;",
"type": "EUtilsServiceStub",
"var_name": "service"
},
{
"declarator": "service2",
"modifier": "private",
"original_string": "private EFetchPubmedServiceStub service2;",
"type": "EFetchPubmedServiceStub",
"var_name": "service2"
}
],
"file": "modules/bluima_pubmed_ws/src/main/java/ch/epfl/bbp/uima/pubmed/PubmedSearch.java",
"identifier": "PubmedSearch",
"interfaces": "",
"methods": [
{
"class_method_signature": "PubmedSearch.PubmedSearch()",
"constructor": true,
"full_signature": "public PubmedSearch()",
"identifier": "PubmedSearch",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PubmedSearch()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.init()",
"constructor": false,
"full_signature": "private void init()",
"identifier": "init",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query, int maxNrResults)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query, int maxNrResults)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Iterator<PubmedArticleType> search(String query)\n\t\t\tthrows RemoteException {\n\t\treturn search(query, Integer.MAX_VALUE);\n\t}",
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"invocations": [
"search"
],
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_41 | {
"fields": [
{
"declarator": "LOG = getLogger(MongoPipelineBuilderTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(MongoPipelineBuilderTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_mongodb/src/test/java/ch/epfl/bbp/uima/mongo/MongoPipelineBuilderTest.java",
"identifier": "MongoPipelineBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings(\"unchecked\")\n\t@Test\n\tpublic void test() throws Exception {\n\n\t\tString[] conn = MongoTest.getTestConn(\"MongoPipelineBuilderTest\");\n\t\tLOG.debug(\"using conn {}\", conn);\n\n\t\tLOG.debug(\"PUT SOME INITIAL DATA\");\n\t\tJCas jCas = UimaTests.getTestCas();\n\t\tBlueCasUtil.setDocId(jCas, 17);\n\n\t\tPipelineBuilder pO = new JcasPipelineBuilder(jCas);\n\t\tpO.add(MongoWriter.class, BlueUima.PARAM_DB_CONNECTION, conn);\n\t\tpO.process();\n\n\t\tThread.sleep(1000);\n\n\t\tLOG.debug(\"ADD MORE INCREMETAL DATA: Sentence\");\n\t\tPipelineBuilder p1 = new MongoPipelineBuilder(2, conn, Sentence.class);\n\t\tp1.add(NaiveSentenceSplitterAnnotator.class);\n\t\tp1.process();\n\n\t\tThread.sleep(2000);\n\n\t\tLOG.debug(\"ADD MORE INCREMETAL DATA: Tokens\");\n\t\tPipelineBuilder p2 = new MongoPipelineBuilder(2, conn, Token.class);\n\t\tp2.add(WhitespaceTokenizerAnnotator.class);\n\t\tp2.process();\n\n\t\tThread.sleep(2000);\n\n\t\tLOG.debug(\"GET AGAIN AND SEE IF INCREMENTAL WORKED\");\n\t\tList<JCas> l = asList(createReader(\n\t\t\t\tMongoCollectionReader.class, PARAM_DB_CONNECTION,\n\t\t\t\tconn));\n\t\tassertEquals(1, l.size());\n\n\t\tjCas = l.get(0);\n\t\tassertEquals(17, BlueCasUtil.getHeaderIntDocId(jCas));\n\n\t\tCollection<Token> t = JCasUtil.select(jCas, Token.class);\n\t\tassertEquals(24, t.size());\n\t}",
"class_method_signature": "MongoPipelineBuilderTest.test()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") @Test public void test()",
"identifier": "test",
"invocations": [
"getTestConn",
"debug",
"debug",
"getTestCas",
"setDocId",
"add",
"process",
"sleep",
"debug",
"add",
"process",
"sleep",
"debug",
"add",
"process",
"sleep",
"debug",
"asList",
"createReader",
"assertEquals",
"size",
"get",
"assertEquals",
"getHeaderIntDocId",
"select",
"assertEquals",
"size"
],
"modifiers": "@SuppressWarnings(\"unchecked\") @Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "connection",
"modifier": "private",
"original_string": "private String[] connection;",
"type": "String[]",
"var_name": "connection"
},
{
"declarator": "updateAnnotations",
"modifier": "private",
"original_string": "private String[] updateAnnotations;",
"type": "String[]",
"var_name": "updateAnnotations"
}
],
"file": "modules/bluima_mongodb/src/main/java/ch/epfl/bbp/uima/mongo/MongoPipelineBuilder.java",
"identifier": "MongoPipelineBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "MongoPipelineBuilder.MongoPipelineBuilder(int nrThreads, String[] connection,\n Class<? extends Annotation>... updateAnnotations)",
"constructor": true,
"full_signature": "public MongoPipelineBuilder(int nrThreads, String[] connection,\n Class<? extends Annotation>... updateAnnotations)",
"identifier": "MongoPipelineBuilder",
"modifiers": "public",
"parameters": "(int nrThreads, String[] connection,\n Class<? extends Annotation>... updateAnnotations)",
"return": "",
"signature": " MongoPipelineBuilder(int nrThreads, String[] connection,\n Class<? extends Annotation>... updateAnnotations)",
"testcase": false
},
{
"class_method_signature": "MongoPipelineBuilder.getUpdateAnnotations(\n Class<? extends Annotation>... updateAnnotations)",
"constructor": false,
"full_signature": "private static String[] getUpdateAnnotations(\n Class<? extends Annotation>... updateAnnotations)",
"identifier": "getUpdateAnnotations",
"modifiers": "private static",
"parameters": "(\n Class<? extends Annotation>... updateAnnotations)",
"return": "String[]",
"signature": "String[] getUpdateAnnotations(\n Class<? extends Annotation>... updateAnnotations)",
"testcase": false
},
{
"class_method_signature": "MongoPipelineBuilder.MongoPipelineBuilder(int nrThreads, String[] connection,\n String... updateAnnotations)",
"constructor": true,
"full_signature": "public MongoPipelineBuilder(int nrThreads, String[] connection,\n String... updateAnnotations)",
"identifier": "MongoPipelineBuilder",
"modifiers": "public",
"parameters": "(int nrThreads, String[] connection,\n String... updateAnnotations)",
"return": "",
"signature": " MongoPipelineBuilder(int nrThreads, String[] connection,\n String... updateAnnotations)",
"testcase": false
},
{
"class_method_signature": "MongoPipelineBuilder.process()",
"constructor": false,
"full_signature": "@Override public Boolean process()",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "()",
"return": "Boolean",
"signature": "Boolean process()",
"testcase": false
}
],
"superclass": "extends CpeBuilder"
} | {
"body": "@Override\n public Boolean process() throws ResourceInitializationException,\n CpeDescriptorException {\n try {\n add(MongoUpdateWriter.class, PARAM_DB_CONNECTION, connection,\n PARAM_UPDATE_ANNOTATIONS, updateAnnotations);\n } catch (Exception e) {\n throw new ResourceInitializationException(e);\n }\n return super.process();\n }",
"class_method_signature": "MongoPipelineBuilder.process()",
"constructor": false,
"full_signature": "@Override public Boolean process()",
"identifier": "process",
"invocations": [
"add",
"process"
],
"modifiers": "@Override public",
"parameters": "()",
"return": "Boolean",
"signature": "Boolean process()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_116 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/triechar/VocabularyTest.java",
"identifier": "VocabularyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHello2() {\n Vocabulary v = new Vocabulary(true);\n int he = v.addWord(\"he\");\n assertEquals(1, v.getSize());\n assertEquals(0, he);\n int h = v.addWord(\"h\");\n assertEquals(1, h);\n assertEquals(2, v.getSize());\n int h2 = v.addWord(\"h\");\n assertEquals(2, v.getSize());\n assertEquals(\"h was already in voc\", 1, h2);\n int hello = v.addWord(\"hello\");\n assertEquals(2, hello);\n assertEquals(3, v.getSize());\n\n assertEquals(\"he\", v.getWord(he));\n assertEquals(\"h\", v.getWord(h));\n assertEquals(\"hello\", v.getWord(hello));\n }",
"class_method_signature": "VocabularyTest.testHello2()",
"constructor": false,
"full_signature": "@Test public void testHello2()",
"identifier": "testHello2",
"invocations": [
"addWord",
"assertEquals",
"getSize",
"assertEquals",
"addWord",
"assertEquals",
"assertEquals",
"getSize",
"addWord",
"assertEquals",
"getSize",
"assertEquals",
"addWord",
"assertEquals",
"assertEquals",
"getSize",
"assertEquals",
"getWord",
"assertEquals",
"getWord",
"assertEquals",
"getWord"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testHello2()",
"testcase": true
} | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "nodes",
"modifier": "",
"original_string": "TrieNodeData<Integer>[] nodes;",
"type": "TrieNodeData<Integer>[]",
"var_name": "nodes"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/triechar/Vocabulary.java",
"identifier": "Vocabulary",
"interfaces": "",
"methods": [
{
"class_method_signature": "Vocabulary.Vocabulary(boolean caseSensitive)",
"constructor": true,
"full_signature": "public Vocabulary(boolean caseSensitive)",
"identifier": "Vocabulary",
"modifiers": "public",
"parameters": "(boolean caseSensitive)",
"return": "",
"signature": " Vocabulary(boolean caseSensitive)",
"testcase": false
},
{
"class_method_signature": "Vocabulary.updateBacktracking()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public void updateBacktracking()",
"identifier": "updateBacktracking",
"modifiers": "@SuppressWarnings(\"unchecked\") public",
"parameters": "()",
"return": "void",
"signature": "void updateBacktracking()",
"testcase": false
},
{
"class_method_signature": "Vocabulary.getWord(int id)",
"constructor": false,
"full_signature": "public String getWord(int id)",
"identifier": "getWord",
"modifiers": "public",
"parameters": "(int id)",
"return": "String",
"signature": "String getWord(int id)",
"testcase": false
}
],
"superclass": "extends TrieId"
} | {
"body": "public String getWord(int id) {\n if (nodes == null)\n updateBacktracking();\n TrieNodeData<Integer> node = nodes[id];\n\n StringBuilder sb = new StringBuilder();\n node.getWord(sb);\n\n return sb.toString();\n }",
"class_method_signature": "Vocabulary.getWord(int id)",
"constructor": false,
"full_signature": "public String getWord(int id)",
"identifier": "getWord",
"invocations": [
"updateBacktracking",
"getWord",
"toString"
],
"modifiers": "public",
"parameters": "(int id)",
"return": "String",
"signature": "String getWord(int id)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_57 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/filter/KeepsCleanerTest.java",
"identifier": "KeepsCleanerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOnlyPunctAndNumbers() {\n assertFalse(isOnlyPunctAndNumbers(\"a{b}c(dd[e]v)g\"));\n assertTrue(isOnlyPunctAndNumbers(\"10(-10\"));\n assertTrue(isOnlyPunctAndNumbers(\"1:200,000\"));\n\n }",
"class_method_signature": "KeepsCleanerTest.testOnlyPunctAndNumbers()",
"constructor": false,
"full_signature": "@Test public void testOnlyPunctAndNumbers()",
"identifier": "testOnlyPunctAndNumbers",
"invocations": [
"assertFalse",
"isOnlyPunctAndNumbers",
"assertTrue",
"isOnlyPunctAndNumbers",
"assertTrue",
"isOnlyPunctAndNumbers"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testOnlyPunctAndNumbers()",
"testcase": true
} | {
"fields": [
{
"declarator": "minLength = 3",
"modifier": "private final",
"original_string": "private final int minLength = 3;",
"type": "int",
"var_name": "minLength"
},
{
"declarator": "PARAM_TRANSFORM_LOWERCASE = \"transformLowercase\"",
"modifier": "private static final",
"original_string": "private static final String PARAM_TRANSFORM_LOWERCASE = \"transformLowercase\";",
"type": "String",
"var_name": "PARAM_TRANSFORM_LOWERCASE"
},
{
"declarator": "transformLowercase",
"modifier": "@ConfigurationParameter(name = PARAM_TRANSFORM_LOWERCASE, mandatory = false, defaultValue = \"true\",//\n description = \"Whether to transform lowercase all the Keep's getNormalizedText()\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_TRANSFORM_LOWERCASE, mandatory = false, defaultValue = \"true\",//\n description = \"Whether to transform lowercase all the Keep's getNormalizedText()\")\n private boolean transformLowercase;",
"type": "boolean",
"var_name": "transformLowercase"
},
{
"declarator": "onlyPunctAndNumbers = Pattern\n .compile(\"^(?:\\\\p{Punct}|\\\\d)+$\")",
"modifier": "private static final",
"original_string": "private static final Pattern onlyPunctAndNumbers = Pattern\n .compile(\"^(?:\\\\p{Punct}|\\\\d)+$\");",
"type": "Pattern",
"var_name": "onlyPunctAndNumbers"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/filter/KeepsCleaner.java",
"identifier": "KeepsCleaner",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeepsCleaner.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "KeepsCleaner.isOnlyPunctAndNumbers(String txt)",
"constructor": false,
"full_signature": "public static boolean isOnlyPunctAndNumbers(String txt)",
"identifier": "isOnlyPunctAndNumbers",
"modifiers": "public static",
"parameters": "(String txt)",
"return": "boolean",
"signature": "boolean isOnlyPunctAndNumbers(String txt)",
"testcase": false
},
{
"class_method_signature": "KeepsCleaner.isBalanced(final String expression)",
"constructor": false,
"full_signature": "public static boolean isBalanced(final String expression)",
"identifier": "isBalanced",
"modifiers": "public static",
"parameters": "(final String expression)",
"return": "boolean",
"signature": "boolean isBalanced(final String expression)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public static boolean isOnlyPunctAndNumbers(String txt) {\n return onlyPunctAndNumbers.matcher(txt).matches();\n }",
"class_method_signature": "KeepsCleaner.isOnlyPunctAndNumbers(String txt)",
"constructor": false,
"full_signature": "public static boolean isOnlyPunctAndNumbers(String txt)",
"identifier": "isOnlyPunctAndNumbers",
"invocations": [
"matches",
"matcher"
],
"modifiers": "public static",
"parameters": "(String txt)",
"return": "boolean",
"signature": "boolean isOnlyPunctAndNumbers(String txt)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_94 | {
"fields": [
{
"declarator": "pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\"",
"modifier": "final static",
"original_string": "final static String pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\";",
"type": "String",
"var_name": "pmId16196030"
}
],
"file": "modules/bluima_abbreviations/src/test/java/ch/epfl/bbp/uima/AbbreviationExpanderTest.java",
"identifier": "AbbreviationExpanderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testTwoDefs() throws Exception {\n\n String txt = \"The subthalamic nucleus (STh) is a brain region. The STh (subthalamic nucleus) is here.\";\n assertEquals(\n \"two definitions, should work\",\n \"The subthalamic nucleus is a brain region. The subthalamic nucleus is here.\",\n expand(txt));\n }",
"class_method_signature": "AbbreviationExpanderTest.testTwoDefs()",
"constructor": false,
"full_signature": "@Test public void testTwoDefs()",
"identifier": "testTwoDefs",
"invocations": [
"assertEquals",
"expand"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testTwoDefs()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(AbbreviationExpander.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = getLogger(AbbreviationExpander.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "model = null",
"modifier": "private static",
"original_string": "private static AlignmentPredictionModel model = null;",
"type": "AlignmentPredictionModel",
"var_name": "model"
}
],
"file": "modules/bluima_abbreviations/src/main/java/ch/epfl/bbp/uima/AbbreviationExpander.java",
"identifier": "AbbreviationExpander",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbbreviationExpander.AbbreviationExpander()",
"constructor": true,
"full_signature": "private AbbreviationExpander()",
"identifier": "AbbreviationExpander",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " AbbreviationExpander()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getModel()",
"constructor": false,
"full_signature": "static private AlignmentPredictionModel getModel()",
"identifier": "getModel",
"modifiers": "static private",
"parameters": "()",
"return": "AlignmentPredictionModel",
"signature": "AlignmentPredictionModel getModel()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getAbbrevs(String txt)",
"constructor": false,
"full_signature": "static public Set<Abbrev> getAbbrevs(String txt)",
"identifier": "getAbbrevs",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "Set<Abbrev>",
"signature": "Set<Abbrev> getAbbrevs(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt, Set<Abbrev> abbrevs)",
"constructor": false,
"full_signature": "static public String expand(String txt, Set<Abbrev> abbrevs)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt, Set<Abbrev> abbrevs)",
"return": "String",
"signature": "String expand(String txt, Set<Abbrev> abbrevs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static public String expand(String txt) {\n return expand(txt, getAbbrevs(txt));\n }",
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"invocations": [
"expand",
"getAbbrevs"
],
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_82 | {
"fields": [
{
"declarator": "LOG = getLogger(OscarAnnotatorTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(OscarAnnotatorTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_oscar4/src/test/java/ch/epfl/bbp/uima/ae/OscarAnnotatorTest.java",
"identifier": "OscarAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n JCas jCas = getTestCas(\"Synthesis of the brown dropwise Hyperbranched Macroligands via Michael Addition of Butyl or Ethyl Acrylate with HPEI. The synthetic procedure for partially EA- or BA-modified HPEI is exemplified for HPEI25K-EA0.79: 1.00 g of HPEI25K (Mn = 2.50 x 104, 23.3 mmol of amine groups) was dissolved in 5.00 mL of THF, and then 2.52 mL (23.3 mmol) of EA was added. The mixture was stirred at room temperature for 24 h and subsequently at 50 °C for another 24 h. 6 wt. % at 333 K.\");\n\n runPipeline(jCas, OscarAnnotator.getAED());\n\n Collection<Chemical> chemicals = select(jCas, Chemical.class);\n LOG.debug(To.string(\"matched chemicals\", chemicals));\n assertEquals(8, chemicals.size());\n // UimaTests.assertResultsContains(chemicals, \"id\", 1);\n }",
"class_method_signature": "OscarAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getTestCas",
"runPipeline",
"getAED",
"select",
"debug",
"string",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "oscar = new Oscar()",
"modifier": "private",
"original_string": "private Oscar oscar = new Oscar();",
"type": "Oscar",
"var_name": "oscar"
},
{
"declarator": "RELEVANT_TYPES = Arrays\n .asList(new NamedEntityType[] { //\n COMPOUND, COMPOUNDS, GROUP, REACTION, LOCANTPREFIX, ASE, ASES,\n POLYMER })",
"modifier": "public static final",
"original_string": "public static final List<NamedEntityType> RELEVANT_TYPES = Arrays\n .asList(new NamedEntityType[] { //\n COMPOUND, COMPOUNDS, GROUP, REACTION, LOCANTPREFIX, ASE, ASES,\n POLYMER });",
"type": "List<NamedEntityType>",
"var_name": "RELEVANT_TYPES"
}
],
"file": "modules/bluima_oscar4/src/main/java/ch/epfl/bbp/uima/ae/OscarAnnotator.java",
"identifier": "OscarAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "OscarAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.getAED()",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getAED()",
"identifier": "getAED",
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getAED()",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.getAE()",
"constructor": false,
"full_signature": "public static AnalysisEngine getAE()",
"identifier": "getAE",
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngine",
"signature": "AnalysisEngine getAE()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public static AnalysisEngineDescription getAED()\n throws ResourceInitializationException {\n return createEngineDescription(OscarAnnotator.class);\n }",
"class_method_signature": "OscarAnnotator.getAED()",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getAED()",
"identifier": "getAED",
"invocations": [
"createEngineDescription"
],
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getAED()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_0 | {
"fields": [],
"file": "modules/bluima_protein_concentrations/src/test/java/ch/epfl/bbp/nlp/ie/proteinconc/ae/ChunkAdapterTest.java",
"identifier": "ChunkAdapterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void endOfSentenceTest() throws Exception {\n\t\tSimplePipelineBuilder builder = new SimplePipelineBuilder(\n\t\t\t\tcreateReaderDescription(PdfCollectionReader.class,//\n\t\t\t\t\t\tPARAM_INPUT_DIRECTORY, EXTRACT_ROOT\n\t\t\t\t\t\t\t\t+ \"src/test/resources/test_pdfs/chunk_adapter\"));\n\n\t\tbuilder.add(getSentenceSplitter());\n\t\tbuilder.add(getTokenizer());\n\t\tbuilder.add(getPosTagger());\n\t\tbuilder.add(getChunker());\n\t\tbuilder.add(createEngineDescription(ChunkAdapter.class));\n\t\tbuilder.add(ChunkController.class);\n\t\tbuilder.process();\n\t}",
"class_method_signature": "ChunkAdapterTest.endOfSentenceTest()",
"constructor": false,
"full_signature": "@Test public void endOfSentenceTest()",
"identifier": "endOfSentenceTest",
"invocations": [
"createReaderDescription",
"add",
"getSentenceSplitter",
"add",
"getTokenizer",
"add",
"getPosTagger",
"add",
"getChunker",
"add",
"createEngineDescription",
"add",
"process"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void endOfSentenceTest()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_protein_concentrations/src/main/java/ch/epfl/bbp/nlp/ie/proteinconc/ae/ChunkAdapter.java",
"identifier": "ChunkAdapter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ChunkAdapter.process(JCas cas)",
"constructor": false,
"full_signature": "@Override public void process(JCas cas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas cas)",
"return": "void",
"signature": "void process(JCas cas)",
"testcase": false
},
{
"class_method_signature": "ChunkAdapter.removeChunks(List<Chunk> oldChunks)",
"constructor": false,
"full_signature": "private static void removeChunks(List<Chunk> oldChunks)",
"identifier": "removeChunks",
"modifiers": "private static",
"parameters": "(List<Chunk> oldChunks)",
"return": "void",
"signature": "void removeChunks(List<Chunk> oldChunks)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas cas) throws AnalysisEngineProcessException {\n int casEnd = cas.getDocumentText().length() - 1;\n final List<Chunk> oldChunksToDelete = new LinkedList<Chunk>();\n for (Chunk chunk : select(cas, Chunk.class)) {\n\n //OpenNLP sometimes set 0 to the end of a chunk (for the last chunk of a Cas).\n // That is, the following logic should correct that.\n final String coveredText =\n (chunk.getEnd() > 0) ? chunk.getCoveredText() : cas.getDocumentText().substring(chunk.getBegin(), casEnd);\n\n\n if (coveredText.contains(\",\")) {\n\n oldChunksToDelete.add(chunk);\n final int originalBegin = chunk.getBegin();\n\n int begin = originalBegin;\n int end = originalBegin + coveredText.indexOf(\",\", begin - originalBegin);\n\n String[] innterChunksStr = coveredText.split(\",\");\n for (String innerChunkStr : innterChunksStr) {\n //creation of the new chunk\n Chunk innerChunk = new Chunk(cas);\n innerChunk.setBegin(begin);\n innerChunk.setEnd(end);\n innerChunk.addToIndexes();\n\n begin = end + 1;\n end = originalBegin + coveredText.indexOf(\",\", begin - originalBegin);\n if (end == originalBegin-1 || end > chunk.getEnd()) { //meaning that there is no more commas in the chunk\n\n end = chunk.getEnd();\n }\n\n }\n }\n }\n\n removeChunks(oldChunksToDelete);\n\n for (Protein protein : select(cas, Protein.class)) {\n final String documentText = cas.getDocumentText();\n final int proteinEnd = protein.getEnd();\n int nextParenthesisPosition = documentText.indexOf(\"(\", proteinEnd);\n\n if ((nextParenthesisPosition != -1) &&\n (documentText.substring(proteinEnd, nextParenthesisPosition).matches(\"\\\\s*\"))) {\n //if we are here, it means we have a pattern of the form \"[PROTEIN] (\"\n //we need to make sure that what is in the parenthesis after the protein NE is a concentration\n\n int nextClosedParenthesisPosition = documentText.indexOf(\")\", nextParenthesisPosition);\n if (nextClosedParenthesisPosition != -1) {\n\n Annotation innerParenthesisDelimiter =\n new Annotation(cas, nextParenthesisPosition, nextClosedParenthesisPosition + 1);\n Collection<Measure> measures = selectCovered(cas, Measure.class, innerParenthesisDelimiter);\n\n if (measures.size() > 0) { // if there is one measure NE in the parenthesis following the protein NE\n\n //we try to find the start and the end of the chunk covering both the protein and the measure\n Collection<Chunk> chunksCoveringProtein = selectCovering(cas, Chunk.class, protein);\n Collection<Chunk> chunksCoveredByParenthesis = selectCovered(cas, Chunk.class, innerParenthesisDelimiter);\n\n int newChunkBegin = Integer.MAX_VALUE;\n int newChunkEnd = 0;\n\n for (Chunk chunkCoveringProtein: chunksCoveringProtein) {\n int begin = chunkCoveringProtein.getBegin();\n if (begin < newChunkBegin) {\n newChunkBegin = begin;\n }\n oldChunksToDelete.add(chunkCoveringProtein);\n }\n\n for (Chunk chunkCoveredByParenthesis: chunksCoveredByParenthesis) {\n int end = chunkCoveredByParenthesis.getEnd();\n if (end > newChunkEnd) {\n newChunkEnd = end;\n }\n oldChunksToDelete.add(chunkCoveredByParenthesis);\n }\n\n Chunk chunkCoveringProteinAndMeasure = new Chunk(cas, newChunkBegin, newChunkEnd);\n chunkCoveringProteinAndMeasure.addToIndexes();\n }\n }\n\n }\n }\n\n\n removeChunks(oldChunksToDelete);\n }",
"class_method_signature": "ChunkAdapter.process(JCas cas)",
"constructor": false,
"full_signature": "@Override public void process(JCas cas)",
"identifier": "process",
"invocations": [
"length",
"getDocumentText",
"select",
"getEnd",
"getCoveredText",
"substring",
"getDocumentText",
"getBegin",
"contains",
"add",
"getBegin",
"indexOf",
"split",
"setBegin",
"setEnd",
"addToIndexes",
"indexOf",
"getEnd",
"getEnd",
"removeChunks",
"select",
"getDocumentText",
"getEnd",
"indexOf",
"matches",
"substring",
"indexOf",
"selectCovered",
"size",
"selectCovering",
"selectCovered",
"getBegin",
"add",
"getEnd",
"add",
"addToIndexes",
"removeChunks"
],
"modifiers": "@Override public",
"parameters": "(JCas cas)",
"return": "void",
"signature": "void process(JCas cas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_77 | {
"fields": [],
"file": "modules/bluima_units/src/test/java/ch/epfl/bbp/uima/units/normalizers/NumberNormalizerTest.java",
"identifier": "NumberNormalizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test() {\n\t\tassertEquals(\"500\", NumberNormalizer.normalizeExponents(\"5E2\"));\n\t\tassertEquals(\"0.05\", NumberNormalizer.normalizeExponents(\"5E-2\"));\n\t\tassertEquals(\"1200\", NumberNormalizer.normalizeExponents(\"12x10(2)\"));\n\t\tassertEquals(\"0.0005\", NumberNormalizer.normalizeExponents(\"5x10(-4)\"));\n\t\tassertEquals(\"0.0005\", NumberNormalizer.normalizeExponents(\"5x10(-4⊂⊃)\"));\n\t}",
"class_method_signature": "NumberNormalizerTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"assertEquals",
"normalizeExponents",
"assertEquals",
"normalizeExponents",
"assertEquals",
"normalizeExponents",
"assertEquals",
"normalizeExponents",
"assertEquals",
"normalizeExponents"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "writtenNumbersNormalizer",
"modifier": "private",
"original_string": "private WrittenNumbersNormalizer writtenNumbersNormalizer;",
"type": "WrittenNumbersNormalizer",
"var_name": "writtenNumbersNormalizer"
},
{
"declarator": "FORMATTER = new DecimalFormat(\n \"#.##############################\")",
"modifier": "public static final",
"original_string": "public static final DecimalFormat FORMATTER = new DecimalFormat(\n \"#.##############################\");",
"type": "DecimalFormat",
"var_name": "FORMATTER"
},
{
"declarator": "eExp = Pattern\n .compile(\"(.*?)[eE]([+-])?(\\\\d+)\")",
"modifier": "private static final",
"original_string": "private static final Pattern eExp = Pattern\n .compile(\"(.*?)[eE]([+-])?(\\\\d+)\");",
"type": "Pattern",
"var_name": "eExp"
},
{
"declarator": "xExp = Pattern\n .compile(\"(.*?)[xX] ?10 ?\\\\(([+-])?(\\\\d+)(?:⊂⊃)?\\\\)\");",
"modifier": "private static final",
"original_string": "private static final Pattern xExp = Pattern\n .compile(\"(.*?)[xX] ?10 ?\\\\(([+-])?(\\\\d+)(?:⊂⊃)?\\\\)\");",
"type": "Pattern",
"var_name": "xExp"
}
],
"file": "modules/bluima_units/src/main/java/ch/epfl/bbp/uima/units/normalizers/NumberNormalizer.java",
"identifier": "NumberNormalizer",
"interfaces": "implements\n org.apache.uima.annotator.regex.extension.Normalization",
"methods": [
{
"class_method_signature": "NumberNormalizer.NumberNormalizer()",
"constructor": true,
"full_signature": "public NumberNormalizer()",
"identifier": "NumberNormalizer",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " NumberNormalizer()",
"testcase": false
},
{
"class_method_signature": "NumberNormalizer.normalize(String input, String ruleId)",
"constructor": false,
"full_signature": "public String normalize(String input, String ruleId)",
"identifier": "normalize",
"modifiers": "public",
"parameters": "(String input, String ruleId)",
"return": "String",
"signature": "String normalize(String input, String ruleId)",
"testcase": false
},
{
"class_method_signature": "NumberNormalizer.normalizeComma(String input)",
"constructor": false,
"full_signature": "private String normalizeComma(String input)",
"identifier": "normalizeComma",
"modifiers": "private",
"parameters": "(String input)",
"return": "String",
"signature": "String normalizeComma(String input)",
"testcase": false
},
{
"class_method_signature": "NumberNormalizer.normalizeExponents(String input)",
"constructor": false,
"full_signature": "public static String normalizeExponents(String input)",
"identifier": "normalizeExponents",
"modifiers": "public static",
"parameters": "(String input)",
"return": "String",
"signature": "String normalizeExponents(String input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String normalizeExponents(String input) {\n Matcher m = eExp.matcher(input);\n if (m.find()) {\n\n Float number = Float.parseFloat(m.group(1));\n int exp = Integer.parseInt(m.group(3));\n boolean negative = m.group(2) != null && m.group(2).equals(\"-\");\n if (negative)\n exp *= -1;\n\n return FORMATTER.format(number * Math.pow(10, exp));\n }\n\n // TODO refactor into 1\n m = xExp.matcher(input);\n if (m.find()) {\n\n Float number = Float.parseFloat(m.group(1));\n int exp = Integer.parseInt(m.group(3));\n boolean negative = m.group(2) != null && m.group(2).equals(\"-\");\n if (negative)\n exp *= -1;\n\n String s = FORMATTER.format(number * Math.pow(10, exp));\n return s;\n }\n\n return input;\n }",
"class_method_signature": "NumberNormalizer.normalizeExponents(String input)",
"constructor": false,
"full_signature": "public static String normalizeExponents(String input)",
"identifier": "normalizeExponents",
"invocations": [
"matcher",
"find",
"parseFloat",
"group",
"parseInt",
"group",
"group",
"equals",
"group",
"format",
"pow",
"matcher",
"find",
"parseFloat",
"group",
"parseInt",
"group",
"group",
"equals",
"group",
"format",
"pow"
],
"modifiers": "public static",
"parameters": "(String input)",
"return": "String",
"signature": "String normalizeExponents(String input)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_98 | {
"fields": [],
"file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java",
"identifier": "PubmedSearchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMesh() throws Exception {\n List<Integer> articles = new PubmedSearch().searchIds(\"Axons[mesh]\");\n assertTrue(articles.size() > 10000);\n }",
"class_method_signature": "PubmedSearchTest.testMesh()",
"constructor": false,
"full_signature": "@Test public void testMesh()",
"identifier": "testMesh",
"invocations": [
"searchIds",
"assertTrue",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMesh()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "service",
"modifier": "private",
"original_string": "private EUtilsServiceStub service;",
"type": "EUtilsServiceStub",
"var_name": "service"
},
{
"declarator": "service2",
"modifier": "private",
"original_string": "private EFetchPubmedServiceStub service2;",
"type": "EFetchPubmedServiceStub",
"var_name": "service2"
}
],
"file": "modules/bluima_pubmed_ws/src/main/java/ch/epfl/bbp/uima/pubmed/PubmedSearch.java",
"identifier": "PubmedSearch",
"interfaces": "",
"methods": [
{
"class_method_signature": "PubmedSearch.PubmedSearch()",
"constructor": true,
"full_signature": "public PubmedSearch()",
"identifier": "PubmedSearch",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PubmedSearch()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.init()",
"constructor": false,
"full_signature": "private void init()",
"identifier": "init",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query, int maxNrResults)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query, int maxNrResults)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<Integer> searchIds(String query) throws RemoteException {\n\n\t\tEUtilsServiceStub.ESearchRequest req = new EUtilsServiceStub.ESearchRequest();\n\t\treq.setDb(\"pubmed\");\n\t\treq.setEmail(\"georges@gmail.com\");\n\t\treq.setTerm(query);\n\t\treq.setRetStart(\"0\");\n\t\treq.setRetMax(Integer.MAX_VALUE + \"\");\n\t\tEUtilsServiceStub.ESearchResult res = service.run_eSearch(req);\n\t\tint count = new Integer(res.getCount());\n\t\tLOG.debug(\"Found {} ids for query '{}'\", count, query);\n\n\t\tList<Integer> articleIds = new ArrayList<Integer>();\n\t\tif (count==0)\n\t\t return articleIds;\n\t\tString[] idList = res.getIdList().getId();\n\t\tfor (String id : idList) {\n\t\t\tarticleIds.add(new Integer(id));\n\t\t}\n\t\tassert (count == articleIds.size()) : \"result counts should match, \"\n\t\t\t\t+ articleIds.size() + \":\" + count;\n\t\treturn articleIds;\n\t}",
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"invocations": [
"setDb",
"setEmail",
"setTerm",
"setRetStart",
"setRetMax",
"run_eSearch",
"getCount",
"debug",
"getId",
"getIdList",
"add",
"size",
"size"
],
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_20 | {
"fields": [
{
"declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())",
"modifier": "static final",
"original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());",
"type": "IteratorWithPrevious<String>",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\"",
"modifier": "final static",
"original_string": "final static String TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\";",
"type": "String",
"var_name": "TEST_PARSE_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/PipelineScriptParserTest.java",
"identifier": "PipelineScriptParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseAe_fromCleanup_simpleName() throws Exception {\n PipelineScriptParser.parseAE(\"ae: \" + BartWriter.class.getSimpleName(),\n EMPTY_ARGS, new Pipeline());\n }",
"class_method_signature": "PipelineScriptParserTest.testParseAe_fromCleanup_simpleName()",
"constructor": false,
"full_signature": "@Test public void testParseAe_fromCleanup_simpleName()",
"identifier": "testParseAe_fromCleanup_simpleName",
"invocations": [
"parseAE",
"getSimpleName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAe_fromCleanup_simpleName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(PipelineScriptParser.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java",
"identifier": "PipelineScriptParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"constructor": false,
"full_signature": "private static Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"identifier": "parseAndDispatch",
"modifiers": "private static",
"parameters": "(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseMaxErrors(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseMaxErrors(String current, Pipeline pipeline)",
"identifier": "parseMaxErrors",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseMaxErrors(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseThreads(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseThreads(String current, Pipeline pipeline)",
"identifier": "parseThreads",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseThreads(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parsePython",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseJava",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"constructor": false,
"full_signature": "private static void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"identifier": "parseInclude",
"modifiers": "private static",
"parameters": "(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"return": "void",
"signature": "void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"identifier": "parseAEJava",
"modifiers": "private static",
"parameters": "(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"return": "void",
"signature": "void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") private static void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseCR",
"modifiers": "@SuppressWarnings(\"unchecked\") private static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.validateParams(List<Object> params, Class<?> classz)",
"constructor": false,
"full_signature": "private static void validateParams(List<Object> params, Class<?> classz)",
"identifier": "validateParams",
"modifiers": "private static",
"parameters": "(List<Object> params, Class<?> classz)",
"return": "void",
"signature": "void validateParams(List<Object> params, Class<?> classz)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseNextLines(IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "private static String parseNextLines(IteratorWithPrevious<String> it)",
"identifier": "parseNextLines",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it)",
"return": "String",
"signature": "String parseNextLines(IteratorWithPrevious<String> it)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@SuppressWarnings(\"unchecked\")\n static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline) throws ParseException {\n LOG.info(\"+-parsing line '{}'\", line);\n\n String aeName = line.replaceFirst(\"ae: \", \"\").trim();\n if (aeName.endsWith(\".xml\")) {\n File aeXml = new File(aeName.replaceAll(\"\\\\$ROOT\",\n BlueUima.BLUE_UIMA_ROOT));\n if (!aeXml.exists())\n throw new ParseException(\"no xml descriptor found at \"\n + aeXml.getAbsolutePath(), -1);\n\n Pair<List<Object>, String> params = parseParams(it);\n\n // create ae\n try {\n pipeline.addAe(createEngineDescriptionFromPath(\n aeXml.getAbsolutePath(), params.getKey().toArray()));\n } catch (Exception e) {\n throw new ParseException(\n \"could not instantiate CollectionReader, error: \"\n + e.getMessage(), -1);\n }\n\n } else {\n\n if (aeName.endsWith(\".class\"))\n aeName = aeName.substring(0, aeName.length() - 6);\n\n // instantiate class\n Class<? extends AnalysisComponent> classz = null;\n // first prefix is for exact match, then 1st fallback is the generic\n // package name, then 2nd fallback correspond to packages\n // in bluima_utils\n String[] prefixes = { \"\", \"ch.epfl.bbp.uima.ae.\",\n \"ch.epfl.bbp.uima.ae.output.\",\n \"ch.epfl.bbp.uima.ae.cleanup.\" };\n String tried = \"\";\n for (String prefix : prefixes) {\n\n try {\n tried += prefix + aeName + \" \";\n classz = (Class<? extends AnalysisComponent>) Class\n .forName(prefix + aeName);\n break;\n } catch (Exception e1) {// nope\n }\n }\n if (classz == null)\n throw new ParseException(\"no class found on classpath: \"\n + aeName + \", tried: \" + tried, -1);\n\n Pair<List<Object>, String> params = parseParams(it);\n validateParams(params.getKey(), classz);\n\n // create ae\n try {\n AnalysisEngineDescription aed = AnalysisEngineFactory\n .createEngineDescription(classz, params.getKey()\n .toArray());\n pipeline.addAe(aed);\n\n } catch (ResourceInitializationException e) {\n throw new ParseException(\n \"could not instantiate CollectionReader, error: \"\n + e.getMessage(), -1);\n }\n }\n }",
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"invocations": [
"info",
"trim",
"replaceFirst",
"endsWith",
"replaceAll",
"exists",
"getAbsolutePath",
"parseParams",
"addAe",
"createEngineDescriptionFromPath",
"getAbsolutePath",
"toArray",
"getKey",
"getMessage",
"endsWith",
"substring",
"length",
"forName",
"parseParams",
"validateParams",
"getKey",
"createEngineDescription",
"toArray",
"getKey",
"addAe",
"getMessage"
],
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_36 | {
"fields": [
{
"declarator": "LOG = getLogger(BlueBioLemmatizerTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(BlueBioLemmatizerTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BlueBioLemmatizerTest.java",
"identifier": "BlueBioLemmatizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n String[] expected = StringUtils.split(\n \"long form pressure hydrocephalus (NPH) be classify\", \" \");\n\n JCas jCas = getTokenizedTestCas(//\n \"longs forms pressure hydrocephalus (NPH) was classifying\");\n\n AnalysisEngine ae = createEngine(BlueBioLemmatizer.class);\n ae.process(jCas);\n\n Collection<Token> a = select(jCas, Token.class);\n assertEquals(7, a.size());\n\n int i = 0;\n for (Token t : a) {\n // Lemma lemma = t.getLemma();\n assertNotNull(t.getLemmaStr());\n LOG.debug(\"{} --> {}\", t.getCoveredText(), t.getLemmaStr());\n assertEquals(expected[i++], t.getLemmaStr());\n }\n }",
"class_method_signature": "BlueBioLemmatizerTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"split",
"getTokenizedTestCas",
"createEngine",
"process",
"select",
"assertEquals",
"size",
"assertNotNull",
"getLemmaStr",
"debug",
"getCoveredText",
"getLemmaStr",
"assertEquals",
"getLemmaStr"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "bioLemmatizer = null",
"modifier": "private static",
"original_string": "private static BioLemmatizer bioLemmatizer = null;",
"type": "BioLemmatizer",
"var_name": "bioLemmatizer"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/BlueBioLemmatizer.java",
"identifier": "BlueBioLemmatizer",
"interfaces": "",
"methods": [
{
"class_method_signature": "BlueBioLemmatizer.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueBioLemmatizer.lemmatize(String text, String posTag)",
"constructor": false,
"full_signature": "public synchronized static String lemmatize(String text, String posTag)",
"identifier": "lemmatize",
"modifiers": "public synchronized static",
"parameters": "(String text, String posTag)",
"return": "String",
"signature": "String lemmatize(String text, String posTag)",
"testcase": false
},
{
"class_method_signature": "BlueBioLemmatizer.getLemmatizer()",
"constructor": false,
"full_signature": "private static BioLemmatizer getLemmatizer()",
"identifier": "getLemmatizer",
"modifiers": "private static",
"parameters": "()",
"return": "BioLemmatizer",
"signature": "BioLemmatizer getLemmatizer()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n for (Token t : JCasUtil.select(jCas, Token.class)) {\n String pos = BlueCasUtil.getSinglePosTag(t);\n String lemma = lemmatize(t.getCoveredText(), pos);\n if (lemma != null)\n t.setLemmaStr(lemma);\n }\n }",
"class_method_signature": "BlueBioLemmatizer.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"select",
"getSinglePosTag",
"lemmatize",
"getCoveredText",
"setLemmaStr"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_61 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/utils/StructuredDirectoryTest.java",
"identifier": "StructuredDirectoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecodeFileName() throws Exception {\n\n File outDir = new File(\"target/testStoreFile2\");\n\n File inputFile = new File(\"target/12345678.txt\");\n inputFile.createNewFile();\n\n File newFile = StructuredDirectory.storeFile(outDir, inputFile);\n\n assertEquals(\"cannot decodeFileName\", 12345678,\n StructuredDirectory.decodeFileName(newFile));\n\n assertEquals(\"cannot getFile\", newFile, new File(outDir,\n StructuredDirectory.getFilePath(12345678, \"txt\")));\n\n }",
"class_method_signature": "StructuredDirectoryTest.testDecodeFileName()",
"constructor": false,
"full_signature": "@Test public void testDecodeFileName()",
"identifier": "testDecodeFileName",
"invocations": [
"createNewFile",
"storeFile",
"assertEquals",
"decodeFileName",
"assertEquals",
"getFilePath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDecodeFileName()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java",
"identifier": "StructuredDirectory",
"interfaces": "",
"methods": [
{
"class_method_signature": "StructuredDirectory.getSplit(int docId)",
"constructor": false,
"full_signature": "public static int[] getSplit(int docId)",
"identifier": "getSplit",
"modifiers": "public static",
"parameters": "(int docId)",
"return": "int[]",
"signature": "int[] getSplit(int docId)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.storeFile(File outDir, File inputFile)",
"constructor": false,
"full_signature": "public static File storeFile(File outDir, File inputFile)",
"identifier": "storeFile",
"modifiers": "public static",
"parameters": "(File outDir, File inputFile)",
"return": "File",
"signature": "File storeFile(File outDir, File inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.decodeFileName(File inputFile)",
"constructor": false,
"full_signature": "public static int decodeFileName(File inputFile)",
"identifier": "decodeFileName",
"modifiers": "public static",
"parameters": "(File inputFile)",
"return": "int",
"signature": "int decodeFileName(File inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.decodeFileName(String inputFile)",
"constructor": false,
"full_signature": "public static int decodeFileName(String inputFile)",
"identifier": "decodeFileName",
"modifiers": "public static",
"parameters": "(String inputFile)",
"return": "int",
"signature": "int decodeFileName(String inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.getFilePath(int docId, String extention)",
"constructor": false,
"full_signature": "public static String getFilePath(int docId, String extention)",
"identifier": "getFilePath",
"modifiers": "public static",
"parameters": "(int docId, String extention)",
"return": "String",
"signature": "String getFilePath(int docId, String extention)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int decodeFileName(File inputFile) throws IOException {\n try {\n int ret = parseInt(removeExtension(inputFile.getName()));\n ret += 1000 * parseInt(inputFile.getParentFile().getName());\n ret += 1000000 * parseInt(inputFile.getParentFile().getParentFile()\n .getName());\n return ret;\n } catch (Throwable t) {\n throw new IOException(\"could not decode filename, make sure\"\n + \" it looks like somepath/12/345/678.txt\", t);\n }\n }",
"class_method_signature": "StructuredDirectory.decodeFileName(File inputFile)",
"constructor": false,
"full_signature": "public static int decodeFileName(File inputFile)",
"identifier": "decodeFileName",
"invocations": [
"parseInt",
"removeExtension",
"getName",
"parseInt",
"getName",
"getParentFile",
"parseInt",
"getName",
"getParentFile",
"getParentFile"
],
"modifiers": "public static",
"parameters": "(File inputFile)",
"return": "int",
"signature": "int decodeFileName(File inputFile)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_120 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/FileParseUtilsTest.java",
"identifier": "FileParseUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = NumberFormatException.class)\n public void testWrongInput() {\n parseToIntegerList(\"1.1\", \" \");\n }",
"class_method_signature": "FileParseUtilsTest.testWrongInput()",
"constructor": false,
"full_signature": "@Test(expected = NumberFormatException.class) public void testWrongInput()",
"identifier": "testWrongInput",
"invocations": [
"parseToIntegerList"
],
"modifiers": "@Test(expected = NumberFormatException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testWrongInput()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/FileParseUtils.java",
"identifier": "FileParseUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileParseUtils.parseToDoubleList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Double> parseToDoubleList(String txt, String separator)",
"identifier": "parseToDoubleList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Double>",
"signature": "List<Double> parseToDoubleList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseToFloatList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Float> parseToFloatList(String txt, String separator)",
"identifier": "parseToFloatList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Float>",
"signature": "List<Float> parseToFloatList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseToIntegerList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Integer> parseToIntegerList(String txt, String separator)",
"identifier": "parseToIntegerList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Integer>",
"signature": "List<Integer> parseToIntegerList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntDouble(String file,\n String separator)",
"constructor": false,
"full_signature": "public static Map<Integer, Double> parseIntDouble(String file,\n String separator)",
"identifier": "parseIntDouble",
"modifiers": "public static",
"parameters": "(String file,\n String separator)",
"return": "Map<Integer, Double>",
"signature": "Map<Integer, Double> parseIntDouble(String file,\n String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntInt(String file,\n String separator)",
"constructor": false,
"full_signature": "public static Map<Integer, Integer> parseIntInt(String file,\n String separator)",
"identifier": "parseIntInt",
"modifiers": "public static",
"parameters": "(String file,\n String separator)",
"return": "Map<Integer, Integer>",
"signature": "Map<Integer, Integer> parseIntInt(String file,\n String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"constructor": false,
"full_signature": "public static List<Integer> parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"identifier": "parseIntColumn",
"modifiers": "public static",
"parameters": "(String file, int column,\n String separator, boolean skipHeader)",
"return": "List<Integer>",
"signature": "List<Integer> parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<Integer> parseToIntegerList(String txt, String separator) {\n if (txt.length() == 0)\n return new ArrayList<Integer>();\n String[] split = txt.trim().split(separator);\n List<Integer> ret = new ArrayList<Integer>(split.length);\n for (String s : split)\n ret.add(Integer.parseInt(s.trim()));\n return ret;\n }",
"class_method_signature": "FileParseUtils.parseToIntegerList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Integer> parseToIntegerList(String txt, String separator)",
"identifier": "parseToIntegerList",
"invocations": [
"length",
"split",
"trim",
"add",
"parseInt",
"trim"
],
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Integer>",
"signature": "List<Integer> parseToIntegerList(String txt, String separator)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_60 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/utils/StructuredDirectoryTest.java",
"identifier": "StructuredDirectoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testStoreFile() throws Exception {\n\n File outDir = new File(\"target/testStoreFile\");\n\n // first test\n File inputFile = new File(\"target/2345678.txt\");\n inputFile.createNewFile();\n\n File newFile = StructuredDirectory.storeFile(outDir, inputFile);\n\n String relativePath = newFile.getAbsolutePath().substring(\n outDir.getAbsolutePath().length());\n relativePath = relativePath.replaceAll(\"\\\\\\\\\", \"/\");// win\n assertEquals(\"/2/345/678.txt\", relativePath);\n\n // second test\n inputFile = new File(\"target/777.txt\");\n inputFile.createNewFile();\n\n newFile = StructuredDirectory.storeFile(outDir, inputFile);\n\n relativePath = newFile.getAbsolutePath().substring(\n outDir.getAbsolutePath().length());\n relativePath = relativePath.replaceAll(\"\\\\\\\\\", \"/\");// win\n assertEquals(\"/0/0/777.txt\", relativePath);\n }",
"class_method_signature": "StructuredDirectoryTest.testStoreFile()",
"constructor": false,
"full_signature": "@Test public void testStoreFile()",
"identifier": "testStoreFile",
"invocations": [
"createNewFile",
"storeFile",
"substring",
"getAbsolutePath",
"length",
"getAbsolutePath",
"replaceAll",
"assertEquals",
"createNewFile",
"storeFile",
"substring",
"getAbsolutePath",
"length",
"getAbsolutePath",
"replaceAll",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testStoreFile()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java",
"identifier": "StructuredDirectory",
"interfaces": "",
"methods": [
{
"class_method_signature": "StructuredDirectory.getSplit(int docId)",
"constructor": false,
"full_signature": "public static int[] getSplit(int docId)",
"identifier": "getSplit",
"modifiers": "public static",
"parameters": "(int docId)",
"return": "int[]",
"signature": "int[] getSplit(int docId)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.storeFile(File outDir, File inputFile)",
"constructor": false,
"full_signature": "public static File storeFile(File outDir, File inputFile)",
"identifier": "storeFile",
"modifiers": "public static",
"parameters": "(File outDir, File inputFile)",
"return": "File",
"signature": "File storeFile(File outDir, File inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.decodeFileName(File inputFile)",
"constructor": false,
"full_signature": "public static int decodeFileName(File inputFile)",
"identifier": "decodeFileName",
"modifiers": "public static",
"parameters": "(File inputFile)",
"return": "int",
"signature": "int decodeFileName(File inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.decodeFileName(String inputFile)",
"constructor": false,
"full_signature": "public static int decodeFileName(String inputFile)",
"identifier": "decodeFileName",
"modifiers": "public static",
"parameters": "(String inputFile)",
"return": "int",
"signature": "int decodeFileName(String inputFile)",
"testcase": false
},
{
"class_method_signature": "StructuredDirectory.getFilePath(int docId, String extention)",
"constructor": false,
"full_signature": "public static String getFilePath(int docId, String extention)",
"identifier": "getFilePath",
"modifiers": "public static",
"parameters": "(int docId, String extention)",
"return": "String",
"signature": "String getFilePath(int docId, String extention)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static File storeFile(File outDir, File inputFile)\n throws IOException {\n\n int docId = parseInt(removeExtension(inputFile.getName()));\n int[] paths = getSplit(docId);\n\n forceMkdir(outDir);\n File dir1 = new File(outDir, paths[0] + \"\");\n forceMkdir(dir1);\n File dir2 = new File(dir1, paths[1] + \"\");\n forceMkdir(dir2);\n\n String newFileName = paths[2] + \".\" + getExtension(inputFile.getName());\n File newFile = new File(dir2, newFileName);\n copyFile(inputFile, newFile);\n return newFile;\n }",
"class_method_signature": "StructuredDirectory.storeFile(File outDir, File inputFile)",
"constructor": false,
"full_signature": "public static File storeFile(File outDir, File inputFile)",
"identifier": "storeFile",
"invocations": [
"parseInt",
"removeExtension",
"getName",
"getSplit",
"forceMkdir",
"forceMkdir",
"forceMkdir",
"getExtension",
"getName",
"copyFile"
],
"modifiers": "public static",
"parameters": "(File outDir, File inputFile)",
"return": "File",
"signature": "File storeFile(File outDir, File inputFile)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_121 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/FileParseUtilsTest.java",
"identifier": "FileParseUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = NumberFormatException.class)\n public void testWrongInput2() {\n parseToIntegerList(\"1\", \"\");\n }",
"class_method_signature": "FileParseUtilsTest.testWrongInput2()",
"constructor": false,
"full_signature": "@Test(expected = NumberFormatException.class) public void testWrongInput2()",
"identifier": "testWrongInput2",
"invocations": [
"parseToIntegerList"
],
"modifiers": "@Test(expected = NumberFormatException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testWrongInput2()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/FileParseUtils.java",
"identifier": "FileParseUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileParseUtils.parseToDoubleList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Double> parseToDoubleList(String txt, String separator)",
"identifier": "parseToDoubleList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Double>",
"signature": "List<Double> parseToDoubleList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseToFloatList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Float> parseToFloatList(String txt, String separator)",
"identifier": "parseToFloatList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Float>",
"signature": "List<Float> parseToFloatList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseToIntegerList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Integer> parseToIntegerList(String txt, String separator)",
"identifier": "parseToIntegerList",
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Integer>",
"signature": "List<Integer> parseToIntegerList(String txt, String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntDouble(String file,\n String separator)",
"constructor": false,
"full_signature": "public static Map<Integer, Double> parseIntDouble(String file,\n String separator)",
"identifier": "parseIntDouble",
"modifiers": "public static",
"parameters": "(String file,\n String separator)",
"return": "Map<Integer, Double>",
"signature": "Map<Integer, Double> parseIntDouble(String file,\n String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntInt(String file,\n String separator)",
"constructor": false,
"full_signature": "public static Map<Integer, Integer> parseIntInt(String file,\n String separator)",
"identifier": "parseIntInt",
"modifiers": "public static",
"parameters": "(String file,\n String separator)",
"return": "Map<Integer, Integer>",
"signature": "Map<Integer, Integer> parseIntInt(String file,\n String separator)",
"testcase": false
},
{
"class_method_signature": "FileParseUtils.parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"constructor": false,
"full_signature": "public static List<Integer> parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"identifier": "parseIntColumn",
"modifiers": "public static",
"parameters": "(String file, int column,\n String separator, boolean skipHeader)",
"return": "List<Integer>",
"signature": "List<Integer> parseIntColumn(String file, int column,\n String separator, boolean skipHeader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<Integer> parseToIntegerList(String txt, String separator) {\n if (txt.length() == 0)\n return new ArrayList<Integer>();\n String[] split = txt.trim().split(separator);\n List<Integer> ret = new ArrayList<Integer>(split.length);\n for (String s : split)\n ret.add(Integer.parseInt(s.trim()));\n return ret;\n }",
"class_method_signature": "FileParseUtils.parseToIntegerList(String txt, String separator)",
"constructor": false,
"full_signature": "public static List<Integer> parseToIntegerList(String txt, String separator)",
"identifier": "parseToIntegerList",
"invocations": [
"length",
"split",
"trim",
"add",
"parseInt",
"trim"
],
"modifiers": "public static",
"parameters": "(String txt, String separator)",
"return": "List<Integer>",
"signature": "List<Integer> parseToIntegerList(String txt, String separator)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_37 | {
"fields": [
{
"declarator": "LOG = getLogger(BlueBioLemmatizerTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(BlueBioLemmatizerTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BlueBioLemmatizerTest.java",
"identifier": "BlueBioLemmatizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testText() throws Exception {\n assertEquals(\"thalamic\", BlueBioLemmatizer.lemmatize(\"Thalamic\", null));\n assertEquals(\"thalamus\", BlueBioLemmatizer.lemmatize(\"thalamus\", null));\n \n assertEquals(\"conditioning\", BlueBioLemmatizer.lemmatize(\"conditioning\", null)); // FAIL!\n assertEquals(\"condition\", BlueBioLemmatizer.lemmatize(\"conditioned\", null));\n\n assertEquals(\"house\", BlueBioLemmatizer.lemmatize(\"houses\", null));\n assertEquals(\"acoustic area\", BlueBioLemmatizer.lemmatize(\"acoustic areas\", null));\n }",
"class_method_signature": "BlueBioLemmatizerTest.testText()",
"constructor": false,
"full_signature": "@Test public void testText()",
"identifier": "testText",
"invocations": [
"assertEquals",
"lemmatize",
"assertEquals",
"lemmatize",
"assertEquals",
"lemmatize",
"assertEquals",
"lemmatize",
"assertEquals",
"lemmatize",
"assertEquals",
"lemmatize"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testText()",
"testcase": true
} | {
"fields": [
{
"declarator": "bioLemmatizer = null",
"modifier": "private static",
"original_string": "private static BioLemmatizer bioLemmatizer = null;",
"type": "BioLemmatizer",
"var_name": "bioLemmatizer"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/BlueBioLemmatizer.java",
"identifier": "BlueBioLemmatizer",
"interfaces": "",
"methods": [
{
"class_method_signature": "BlueBioLemmatizer.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueBioLemmatizer.lemmatize(String text, String posTag)",
"constructor": false,
"full_signature": "public synchronized static String lemmatize(String text, String posTag)",
"identifier": "lemmatize",
"modifiers": "public synchronized static",
"parameters": "(String text, String posTag)",
"return": "String",
"signature": "String lemmatize(String text, String posTag)",
"testcase": false
},
{
"class_method_signature": "BlueBioLemmatizer.getLemmatizer()",
"constructor": false,
"full_signature": "private static BioLemmatizer getLemmatizer()",
"identifier": "getLemmatizer",
"modifiers": "private static",
"parameters": "()",
"return": "BioLemmatizer",
"signature": "BioLemmatizer getLemmatizer()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public synchronized static String lemmatize(String text, String posTag) {\n LemmataEntry lemmata = getLemmatizer().lemmatizeByLexiconAndRules(text,\n posTag);\n\n Collection<edu.ucdenver.ccp.nlp.biolemmatizer.LemmataEntry.Lemma> lemmas = lemmata\n .getLemmas();\n if (!lemmas.isEmpty()) {\n edu.ucdenver.ccp.nlp.biolemmatizer.LemmataEntry.Lemma lemma = lemmas\n .iterator().next();\n return lemma.getLemma();\n } else {\n return null;\n }\n }",
"class_method_signature": "BlueBioLemmatizer.lemmatize(String text, String posTag)",
"constructor": false,
"full_signature": "public synchronized static String lemmatize(String text, String posTag)",
"identifier": "lemmatize",
"invocations": [
"lemmatizeByLexiconAndRules",
"getLemmatizer",
"getLemmas",
"isEmpty",
"next",
"iterator",
"getLemma"
],
"modifiers": "public synchronized static",
"parameters": "(String text, String posTag)",
"return": "String",
"signature": "String lemmatize(String text, String posTag)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_21 | {
"fields": [
{
"declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())",
"modifier": "static final",
"original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());",
"type": "IteratorWithPrevious<String>",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\"",
"modifier": "final static",
"original_string": "final static String TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\";",
"type": "String",
"var_name": "TEST_PARSE_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/PipelineScriptParserTest.java",
"identifier": "PipelineScriptParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMultiline() throws Exception {\n Pair<List<Object>, String> params = PipelineScriptParser\n .parseParams(new IteratorWithPrevious<String>(newArrayList(\n \" a: bla\\\\\", \" bli \")));\n assertEquals(2, params.getKey().size());\n assertEquals(\"bla bli\", params.getKey().get(1));\n\n params = PipelineScriptParser\n .parseParams(new IteratorWithPrevious<String>(newArrayList(\n \" a: bla\\\\\", \" bli\\\\\", \"boo \").listIterator()));\n assertEquals(2, params.getKey().size());\n assertEquals(\"bla bli boo\", params.getKey().get(1));\n }",
"class_method_signature": "PipelineScriptParserTest.testMultiline()",
"constructor": false,
"full_signature": "@Test public void testMultiline()",
"identifier": "testMultiline",
"invocations": [
"parseParams",
"newArrayList",
"assertEquals",
"size",
"getKey",
"assertEquals",
"get",
"getKey",
"parseParams",
"listIterator",
"newArrayList",
"assertEquals",
"size",
"getKey",
"assertEquals",
"get",
"getKey"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMultiline()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(PipelineScriptParser.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java",
"identifier": "PipelineScriptParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"constructor": false,
"full_signature": "private static Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"identifier": "parseAndDispatch",
"modifiers": "private static",
"parameters": "(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseMaxErrors(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseMaxErrors(String current, Pipeline pipeline)",
"identifier": "parseMaxErrors",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseMaxErrors(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseThreads(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseThreads(String current, Pipeline pipeline)",
"identifier": "parseThreads",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseThreads(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parsePython",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseJava",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"constructor": false,
"full_signature": "private static void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"identifier": "parseInclude",
"modifiers": "private static",
"parameters": "(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"return": "void",
"signature": "void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"identifier": "parseAEJava",
"modifiers": "private static",
"parameters": "(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"return": "void",
"signature": "void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") private static void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseCR",
"modifiers": "@SuppressWarnings(\"unchecked\") private static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.validateParams(List<Object> params, Class<?> classz)",
"constructor": false,
"full_signature": "private static void validateParams(List<Object> params, Class<?> classz)",
"identifier": "validateParams",
"modifiers": "private static",
"parameters": "(List<Object> params, Class<?> classz)",
"return": "void",
"signature": "void validateParams(List<Object> params, Class<?> classz)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseNextLines(IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "private static String parseNextLines(IteratorWithPrevious<String> it)",
"identifier": "parseNextLines",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it)",
"return": "String",
"signature": "String parseNextLines(IteratorWithPrevious<String> it)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it) throws ParseException {\n List<Object> params = new ArrayList<Object>();\n String xml = \"\";\n while (it.hasNext()) {\n String current = it.next();\n if (StringUtils.isBlank(current)) // end of parameters\n break;\n if (current.startsWith(\" #\")) // skip comments\n continue;\n if (!current.startsWith(\" \")) {\n it.previous(); // end of parameters\n break;\n }\n\n int split = current.indexOf(\": \");\n if (split == -1) {\n throw new ParseException(\n \"incorrect parameter line, should have a key, followed by a column, followed by a space, followed by a value: '\"\n + current + \"'\", -1);\n }\n String key = current.substring(0, split).trim();\n String valueStr = current.substring(split + 1).trim();\n xml += \"<\" + key + \">\" + escapeXml(valueStr) + \"</\" + key + \">\";\n\n Object value = null;\n if (key.endsWith(\"__java\")) { // interpret as java code\n Interpreter i = new Interpreter();\n key = key.substring(0, key.length() - 6);\n try {\n i.eval(\"value = \" + valueStr + \";\");\n value = i.get(\"value\");\n } catch (Exception e) {\n throw new ParseException(\n \"cannot compile and run '__java' parameter with value '\"\n + valueStr + \"', error:\" + e.toString(), -1);\n }\n } else { // a string\n\n // check if multiline\n if (valueStr.endsWith(\"\\\\\")) {\n value = valueStr.substring(0, valueStr.length() - 1) // rm \\\n + \" \" + parseNextLines(it);\n } else {\n value = valueStr;\n }\n }\n LOG.info(\" +-param. {}=>{}\", key, value);\n\n params.add(key);\n params.add(value);\n }\n return new Pair<List<Object>, String>(params, xml);\n }",
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"invocations": [
"hasNext",
"next",
"isBlank",
"startsWith",
"startsWith",
"previous",
"indexOf",
"trim",
"substring",
"trim",
"substring",
"escapeXml",
"endsWith",
"substring",
"length",
"eval",
"get",
"toString",
"endsWith",
"substring",
"length",
"parseNextLines",
"info",
"add",
"add"
],
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_76 | {
"fields": [],
"file": "modules/bluima_units/src/test/java/ch/epfl/bbp/uima/units/normalizers/FractionNormalizerTest.java",
"identifier": "FractionNormalizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n assertEquals(\"0.5\", normalizeFraction(\"1/2\", null));\n assertEquals(0.12, new Float(normalizeFraction(\"1.2/10\", null)),\n 0.00001);\n }",
"class_method_signature": "FractionNormalizerTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"assertEquals",
"normalizeFraction",
"assertEquals",
"normalizeFraction"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_units/src/main/java/ch/epfl/bbp/uima/units/normalizers/FractionNormalizer.java",
"identifier": "FractionNormalizer",
"interfaces": "implements Normalization",
"methods": [
{
"class_method_signature": "FractionNormalizer.normalize(String input, String ruleId)",
"constructor": false,
"full_signature": "public String normalize(String input, String ruleId)",
"identifier": "normalize",
"modifiers": "public",
"parameters": "(String input, String ruleId)",
"return": "String",
"signature": "String normalize(String input, String ruleId)",
"testcase": false
},
{
"class_method_signature": "FractionNormalizer.normalizeFraction(String input, String ruleId)",
"constructor": false,
"full_signature": "public static String normalizeFraction(String input, String ruleId)",
"identifier": "normalizeFraction",
"modifiers": "public static",
"parameters": "(String input, String ruleId)",
"return": "String",
"signature": "String normalizeFraction(String input, String ruleId)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String normalizeFraction(String input, String ruleId) {\n String[] split = input.split(\"/\");\n return \"\" + (parseFloat(split[0]) / parseFloat(split[1]));\n }",
"class_method_signature": "FractionNormalizer.normalizeFraction(String input, String ruleId)",
"constructor": false,
"full_signature": "public static String normalizeFraction(String input, String ruleId)",
"identifier": "normalizeFraction",
"invocations": [
"split",
"parseFloat",
"parseFloat"
],
"modifiers": "public static",
"parameters": "(String input, String ruleId)",
"return": "String",
"signature": "String normalizeFraction(String input, String ruleId)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_99 | {
"fields": [],
"file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java",
"identifier": "PubmedSearchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPmid() throws Exception {\n List<Integer> articles = new PubmedSearch().searchIds(\"16381840[pmid]\");\n assertTrue(articles.size() == 1);\n articles = new PubmedSearch().searchIds(\"16381840\");\n assertTrue(articles.size() == 1);\n articles = new PubmedSearch().searchIds(\"17170002 16381840\");\n assertTrue(articles.size() == 2);\n }",
"class_method_signature": "PubmedSearchTest.testPmid()",
"constructor": false,
"full_signature": "@Test public void testPmid()",
"identifier": "testPmid",
"invocations": [
"searchIds",
"assertTrue",
"size",
"searchIds",
"assertTrue",
"size",
"searchIds",
"assertTrue",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPmid()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "service",
"modifier": "private",
"original_string": "private EUtilsServiceStub service;",
"type": "EUtilsServiceStub",
"var_name": "service"
},
{
"declarator": "service2",
"modifier": "private",
"original_string": "private EFetchPubmedServiceStub service2;",
"type": "EFetchPubmedServiceStub",
"var_name": "service2"
}
],
"file": "modules/bluima_pubmed_ws/src/main/java/ch/epfl/bbp/uima/pubmed/PubmedSearch.java",
"identifier": "PubmedSearch",
"interfaces": "",
"methods": [
{
"class_method_signature": "PubmedSearch.PubmedSearch()",
"constructor": true,
"full_signature": "public PubmedSearch()",
"identifier": "PubmedSearch",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PubmedSearch()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.init()",
"constructor": false,
"full_signature": "private void init()",
"identifier": "init",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query, int maxNrResults)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query, int maxNrResults)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<Integer> searchIds(String query) throws RemoteException {\n\n\t\tEUtilsServiceStub.ESearchRequest req = new EUtilsServiceStub.ESearchRequest();\n\t\treq.setDb(\"pubmed\");\n\t\treq.setEmail(\"georges@gmail.com\");\n\t\treq.setTerm(query);\n\t\treq.setRetStart(\"0\");\n\t\treq.setRetMax(Integer.MAX_VALUE + \"\");\n\t\tEUtilsServiceStub.ESearchResult res = service.run_eSearch(req);\n\t\tint count = new Integer(res.getCount());\n\t\tLOG.debug(\"Found {} ids for query '{}'\", count, query);\n\n\t\tList<Integer> articleIds = new ArrayList<Integer>();\n\t\tif (count==0)\n\t\t return articleIds;\n\t\tString[] idList = res.getIdList().getId();\n\t\tfor (String id : idList) {\n\t\t\tarticleIds.add(new Integer(id));\n\t\t}\n\t\tassert (count == articleIds.size()) : \"result counts should match, \"\n\t\t\t\t+ articleIds.size() + \":\" + count;\n\t\treturn articleIds;\n\t}",
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"invocations": [
"setDb",
"setEmail",
"setTerm",
"setRetStart",
"setRetMax",
"run_eSearch",
"getCount",
"debug",
"getId",
"getIdList",
"add",
"size",
"size"
],
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_1 | {
"fields": [],
"file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/ConceptMapperParserTest.java",
"identifier": "ConceptMapperParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n File age = new File(XmlHelper.XML_TEST_RESOURCES\n + \"ConceptMapperParser/age.xml\");\n\n Map<String, Concept> onto = ConceptMapperParser.parse(age);\n assertEquals(46, onto.size());\n Concept infant = onto.get(\"age:INFANT\");\n\n assertEquals(4, infant.getVariants().size());\n }",
"class_method_signature": "ConceptMapperParserTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"parse",
"assertEquals",
"size",
"get",
"assertEquals",
"size",
"getVariants"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/ConceptMapperParser.java",
"identifier": "ConceptMapperParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConceptMapperParser.parse(File f)",
"constructor": false,
"full_signature": "public static Map<String, Concept> parse(File f)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File f)",
"return": "Map<String, Concept>",
"signature": "Map<String, Concept> parse(File f)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<String, Concept> parse(File f) throws JDOMException,\n IOException {\n\n Map<String, Concept> concepts = newHashMap();\n\n InputStream corpusIs = new FileInputStream(f);\n\n SAXBuilder builder = new SAXBuilder();\n Document doc = builder.build(corpusIs);\n Element rootNode = doc.getRootElement();\n\n Iterator<Element> tokens = rootNode.getChildren().iterator();\n while (tokens.hasNext()) {\n Element token = tokens.next();\n\n // <token canonical=\"primary cell culture cell\" ref_id=\"CL:0000001\">\n // <variant base=\"primary cell culture cell\" />\n\n String id = token.getAttributeValue(\"ref_id\");\n String canonical = token.getAttributeValue(\"canonical\");\n\n Set<String> variantStrings = newHashSet();\n List<Element> variants = token.getChildren();\n for (Element variant : variants) {\n variantStrings.add(variant.getAttributeValue(\"base\").trim());\n }\n concepts.put(id, new Concept(canonical, id, variantStrings));\n }\n checkArgument(concepts.size() > 0, \"empty concepts!\");\n return concepts;\n }",
"class_method_signature": "ConceptMapperParser.parse(File f)",
"constructor": false,
"full_signature": "public static Map<String, Concept> parse(File f)",
"identifier": "parse",
"invocations": [
"newHashMap",
"build",
"getRootElement",
"iterator",
"getChildren",
"hasNext",
"next",
"getAttributeValue",
"getAttributeValue",
"newHashSet",
"getChildren",
"add",
"trim",
"getAttributeValue",
"put",
"checkArgument",
"size"
],
"modifiers": "public static",
"parameters": "(File f)",
"return": "Map<String, Concept>",
"signature": "Map<String, Concept> parse(File f)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_83 | {
"fields": [
{
"declarator": "LOG = getLogger(OscarAnnotatorTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(OscarAnnotatorTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_oscar4/src/test/java/ch/epfl/bbp/uima/ae/OscarAnnotatorTest.java",
"identifier": "OscarAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDihydrotestosterone() throws Exception {\n\n //JCas jCas = getTestCas(\"Synthesis of 5 alpha-DHT is difficult to realise in laboratory.\");\n JCas jCas = getTestCas(\"Synthesis of 5 α-DHT is difficult to realise in laboratory.\");\n\n runPipeline(jCas, OscarAnnotator.getAED());\n\n Collection<Chemical> chemicals = select(jCas, Chemical.class);\n LOG.debug(To.string(\"matched chemicals\", chemicals));\n assertEquals(1, chemicals.size());\n }",
"class_method_signature": "OscarAnnotatorTest.testDihydrotestosterone()",
"constructor": false,
"full_signature": "@Test public void testDihydrotestosterone()",
"identifier": "testDihydrotestosterone",
"invocations": [
"getTestCas",
"runPipeline",
"getAED",
"select",
"debug",
"string",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDihydrotestosterone()",
"testcase": true
} | {
"fields": [
{
"declarator": "oscar = new Oscar()",
"modifier": "private",
"original_string": "private Oscar oscar = new Oscar();",
"type": "Oscar",
"var_name": "oscar"
},
{
"declarator": "RELEVANT_TYPES = Arrays\n .asList(new NamedEntityType[] { //\n COMPOUND, COMPOUNDS, GROUP, REACTION, LOCANTPREFIX, ASE, ASES,\n POLYMER })",
"modifier": "public static final",
"original_string": "public static final List<NamedEntityType> RELEVANT_TYPES = Arrays\n .asList(new NamedEntityType[] { //\n COMPOUND, COMPOUNDS, GROUP, REACTION, LOCANTPREFIX, ASE, ASES,\n POLYMER });",
"type": "List<NamedEntityType>",
"var_name": "RELEVANT_TYPES"
}
],
"file": "modules/bluima_oscar4/src/main/java/ch/epfl/bbp/uima/ae/OscarAnnotator.java",
"identifier": "OscarAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "OscarAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.getAED()",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getAED()",
"identifier": "getAED",
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getAED()",
"testcase": false
},
{
"class_method_signature": "OscarAnnotator.getAE()",
"constructor": false,
"full_signature": "public static AnalysisEngine getAE()",
"identifier": "getAE",
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngine",
"signature": "AnalysisEngine getAE()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public static AnalysisEngineDescription getAED()\n throws ResourceInitializationException {\n return createEngineDescription(OscarAnnotator.class);\n }",
"class_method_signature": "OscarAnnotator.getAED()",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getAED()",
"identifier": "getAED",
"invocations": [
"createEngineDescription"
],
"modifiers": "public static",
"parameters": "()",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getAED()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_95 | {
"fields": [
{
"declarator": "pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\"",
"modifier": "final static",
"original_string": "final static String pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\";",
"type": "String",
"var_name": "pmId16196030"
}
],
"file": "modules/bluima_abbreviations/src/test/java/ch/epfl/bbp/uima/AbbreviationExpanderTest.java",
"identifier": "AbbreviationExpanderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPmId16196030() throws Exception {\n\n String txt = pmId16196030;\n assertEquals(4, countMatches(txt, \"LH\"));\n\n String txtOut = expand(txt);\n assertEquals(\"should not contain LH: \" + txtOut, 0,\n countMatches(txtOut, \"LH\"));\n }",
"class_method_signature": "AbbreviationExpanderTest.testPmId16196030()",
"constructor": false,
"full_signature": "@Test public void testPmId16196030()",
"identifier": "testPmId16196030",
"invocations": [
"assertEquals",
"countMatches",
"expand",
"assertEquals",
"countMatches"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPmId16196030()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(AbbreviationExpander.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = getLogger(AbbreviationExpander.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "model = null",
"modifier": "private static",
"original_string": "private static AlignmentPredictionModel model = null;",
"type": "AlignmentPredictionModel",
"var_name": "model"
}
],
"file": "modules/bluima_abbreviations/src/main/java/ch/epfl/bbp/uima/AbbreviationExpander.java",
"identifier": "AbbreviationExpander",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbbreviationExpander.AbbreviationExpander()",
"constructor": true,
"full_signature": "private AbbreviationExpander()",
"identifier": "AbbreviationExpander",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " AbbreviationExpander()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getModel()",
"constructor": false,
"full_signature": "static private AlignmentPredictionModel getModel()",
"identifier": "getModel",
"modifiers": "static private",
"parameters": "()",
"return": "AlignmentPredictionModel",
"signature": "AlignmentPredictionModel getModel()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getAbbrevs(String txt)",
"constructor": false,
"full_signature": "static public Set<Abbrev> getAbbrevs(String txt)",
"identifier": "getAbbrevs",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "Set<Abbrev>",
"signature": "Set<Abbrev> getAbbrevs(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt, Set<Abbrev> abbrevs)",
"constructor": false,
"full_signature": "static public String expand(String txt, Set<Abbrev> abbrevs)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt, Set<Abbrev> abbrevs)",
"return": "String",
"signature": "String expand(String txt, Set<Abbrev> abbrevs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static public String expand(String txt) {\n return expand(txt, getAbbrevs(txt));\n }",
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"invocations": [
"expand",
"getAbbrevs"
],
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_117 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/triechar/TrieIdTest.java",
"identifier": "TrieIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testEmptyString() {\n TrieId t = new TrieId();\n t.addWord(\"\");\n }",
"class_method_signature": "TrieIdTest.testEmptyString()",
"constructor": false,
"full_signature": "@Test(expected = IllegalArgumentException.class) public void testEmptyString()",
"identifier": "testEmptyString",
"invocations": [
"addWord"
],
"modifiers": "@Test(expected = IllegalArgumentException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testEmptyString()",
"testcase": true
} | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "protected static final",
"original_string": "protected static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "trie",
"modifier": "protected",
"original_string": "protected TrieData<Integer> trie;",
"type": "TrieData<Integer>",
"var_name": "trie"
},
{
"declarator": "maxId = 0",
"modifier": "protected",
"original_string": "protected int maxId = 0;",
"type": "int",
"var_name": "maxId"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/triechar/TrieId.java",
"identifier": "TrieId",
"interfaces": "implements Serializable",
"methods": [
{
"class_method_signature": "TrieId.TrieId()",
"constructor": true,
"full_signature": "public TrieId()",
"identifier": "TrieId",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " TrieId()",
"testcase": false
},
{
"class_method_signature": "TrieId.TrieId(boolean caseSensitive)",
"constructor": true,
"full_signature": "public TrieId(boolean caseSensitive)",
"identifier": "TrieId",
"modifiers": "public",
"parameters": "(boolean caseSensitive)",
"return": "",
"signature": " TrieId(boolean caseSensitive)",
"testcase": false
},
{
"class_method_signature": "TrieId.getSize()",
"constructor": false,
"full_signature": "public int getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int getSize()",
"testcase": false
},
{
"class_method_signature": "TrieId.addWord(String word)",
"constructor": false,
"full_signature": "public int addWord(String word)",
"identifier": "addWord",
"modifiers": "public",
"parameters": "(String word)",
"return": "int",
"signature": "int addWord(String word)",
"testcase": false
},
{
"class_method_signature": "TrieId.getWordId(String word)",
"constructor": false,
"full_signature": "public int getWordId(String word)",
"identifier": "getWordId",
"modifiers": "public",
"parameters": "(String word)",
"return": "int",
"signature": "int getWordId(String word)",
"testcase": false
},
{
"class_method_signature": "TrieId.toIdsFile(OutputStream os)",
"constructor": false,
"full_signature": "public void toIdsFile(OutputStream os)",
"identifier": "toIdsFile",
"modifiers": "public",
"parameters": "(OutputStream os)",
"return": "void",
"signature": "void toIdsFile(OutputStream os)",
"testcase": false
},
{
"class_method_signature": "TrieId.fromIdsFile(InputStream is)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"resource\") public static TrieId fromIdsFile(InputStream is)",
"identifier": "fromIdsFile",
"modifiers": "@SuppressWarnings(\"resource\") public static",
"parameters": "(InputStream is)",
"return": "TrieId",
"signature": "TrieId fromIdsFile(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int addWord(String word) {\n if (word == null || word.length() == 0)\n throw new IllegalArgumentException(\"word cannot be null or empty\");\n Integer id = trie.getWordData(word);\n if (id == null) {\n id = maxId;\n trie.addWord(word, id);\n maxId++;\n return id;\n } else {\n return id;\n }\n }",
"class_method_signature": "TrieId.addWord(String word)",
"constructor": false,
"full_signature": "public int addWord(String word)",
"identifier": "addWord",
"invocations": [
"length",
"getWordData",
"addWord"
],
"modifiers": "public",
"parameters": "(String word)",
"return": "int",
"signature": "int addWord(String word)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_56 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/filter/KeepsCleanerTest.java",
"identifier": "KeepsCleanerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBalancedParenth() {\n assertTrue(isBalanced(\"a{b}c(dd[e]v)g\"));\n assertFalse(isBalanced(\"([}])\"));\n assertTrue(isBalanced(\"([])\"));\n assertTrue(isBalanced(\"()[]{}[][]\"));\n }",
"class_method_signature": "KeepsCleanerTest.testBalancedParenth()",
"constructor": false,
"full_signature": "@Test public void testBalancedParenth()",
"identifier": "testBalancedParenth",
"invocations": [
"assertTrue",
"isBalanced",
"assertFalse",
"isBalanced",
"assertTrue",
"isBalanced",
"assertTrue",
"isBalanced"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBalancedParenth()",
"testcase": true
} | {
"fields": [
{
"declarator": "minLength = 3",
"modifier": "private final",
"original_string": "private final int minLength = 3;",
"type": "int",
"var_name": "minLength"
},
{
"declarator": "PARAM_TRANSFORM_LOWERCASE = \"transformLowercase\"",
"modifier": "private static final",
"original_string": "private static final String PARAM_TRANSFORM_LOWERCASE = \"transformLowercase\";",
"type": "String",
"var_name": "PARAM_TRANSFORM_LOWERCASE"
},
{
"declarator": "transformLowercase",
"modifier": "@ConfigurationParameter(name = PARAM_TRANSFORM_LOWERCASE, mandatory = false, defaultValue = \"true\",//\n description = \"Whether to transform lowercase all the Keep's getNormalizedText()\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_TRANSFORM_LOWERCASE, mandatory = false, defaultValue = \"true\",//\n description = \"Whether to transform lowercase all the Keep's getNormalizedText()\")\n private boolean transformLowercase;",
"type": "boolean",
"var_name": "transformLowercase"
},
{
"declarator": "onlyPunctAndNumbers = Pattern\n .compile(\"^(?:\\\\p{Punct}|\\\\d)+$\")",
"modifier": "private static final",
"original_string": "private static final Pattern onlyPunctAndNumbers = Pattern\n .compile(\"^(?:\\\\p{Punct}|\\\\d)+$\");",
"type": "Pattern",
"var_name": "onlyPunctAndNumbers"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/filter/KeepsCleaner.java",
"identifier": "KeepsCleaner",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeepsCleaner.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "KeepsCleaner.isOnlyPunctAndNumbers(String txt)",
"constructor": false,
"full_signature": "public static boolean isOnlyPunctAndNumbers(String txt)",
"identifier": "isOnlyPunctAndNumbers",
"modifiers": "public static",
"parameters": "(String txt)",
"return": "boolean",
"signature": "boolean isOnlyPunctAndNumbers(String txt)",
"testcase": false
},
{
"class_method_signature": "KeepsCleaner.isBalanced(final String expression)",
"constructor": false,
"full_signature": "public static boolean isBalanced(final String expression)",
"identifier": "isBalanced",
"modifiers": "public static",
"parameters": "(final String expression)",
"return": "boolean",
"signature": "boolean isBalanced(final String expression)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public static boolean isBalanced(final String expression) {\n\n final char LEFT_NORMAL = '(', RIGHT_NORMAL = ')';\n final char LEFT_CURLY = '{', RIGHT_CURLY = '}';\n final char LEFT_SQUARE = '[', RIGHT_SQUARE = ']';\n\n Stack<Character> stack = new Stack<Character>();\n int i; // An index into the string\n boolean failed = false; // true if a mismatch\n\n for (i = 0; !failed && (i < expression.length()); i++) {\n switch (expression.charAt(i)) {\n case LEFT_NORMAL:\n case LEFT_CURLY:\n case LEFT_SQUARE:\n stack.push(expression.charAt(i));\n break;\n case RIGHT_NORMAL:\n if (stack.isEmpty() || (stack.pop() != LEFT_NORMAL))\n failed = true;\n break;\n case RIGHT_CURLY:\n if (stack.isEmpty() || (stack.pop() != LEFT_CURLY))\n failed = true;\n break;\n case RIGHT_SQUARE:\n if (stack.isEmpty() || (stack.pop() != LEFT_SQUARE))\n failed = true;\n break;\n }\n }\n return (stack.isEmpty() && !failed);\n }",
"class_method_signature": "KeepsCleaner.isBalanced(final String expression)",
"constructor": false,
"full_signature": "public static boolean isBalanced(final String expression)",
"identifier": "isBalanced",
"invocations": [
"length",
"charAt",
"push",
"charAt",
"isEmpty",
"pop",
"isEmpty",
"pop",
"isEmpty",
"pop",
"isEmpty"
],
"modifiers": "public static",
"parameters": "(final String expression)",
"return": "boolean",
"signature": "boolean isBalanced(final String expression)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_101 | {
"fields": [],
"file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java",
"identifier": "PubmedSearchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void testLayers() throws Exception {\n PubmedSearch searcher = new PubmedSearch();\n for (String layer : new LineReader(new FileInputStream(\n \"src/test/resources/20130208_layers.txt\"))) {\n searcher.search(\"\\\"\" + layer + \"\\\"\", 1);\n }\n }",
"class_method_signature": "PubmedSearchTest.testLayers()",
"constructor": false,
"full_signature": "@Test @Ignore public void testLayers()",
"identifier": "testLayers",
"invocations": [
"search"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void testLayers()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "service",
"modifier": "private",
"original_string": "private EUtilsServiceStub service;",
"type": "EUtilsServiceStub",
"var_name": "service"
},
{
"declarator": "service2",
"modifier": "private",
"original_string": "private EFetchPubmedServiceStub service2;",
"type": "EFetchPubmedServiceStub",
"var_name": "service2"
}
],
"file": "modules/bluima_pubmed_ws/src/main/java/ch/epfl/bbp/uima/pubmed/PubmedSearch.java",
"identifier": "PubmedSearch",
"interfaces": "",
"methods": [
{
"class_method_signature": "PubmedSearch.PubmedSearch()",
"constructor": true,
"full_signature": "public PubmedSearch()",
"identifier": "PubmedSearch",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PubmedSearch()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.init()",
"constructor": false,
"full_signature": "private void init()",
"identifier": "init",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void init()",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.searchIds(String query)",
"constructor": false,
"full_signature": "public List<Integer> searchIds(String query)",
"identifier": "searchIds",
"modifiers": "public",
"parameters": "(String query)",
"return": "List<Integer>",
"signature": "List<Integer> searchIds(String query)",
"testcase": false
},
{
"class_method_signature": "PubmedSearch.search(String query, int maxNrResults)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"identifier": "search",
"modifiers": "public",
"parameters": "(String query, int maxNrResults)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query, int maxNrResults)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Iterator<PubmedArticleType> search(String query)\n\t\t\tthrows RemoteException {\n\t\treturn search(query, Integer.MAX_VALUE);\n\t}",
"class_method_signature": "PubmedSearch.search(String query)",
"constructor": false,
"full_signature": "public Iterator<PubmedArticleType> search(String query)",
"identifier": "search",
"invocations": [
"search"
],
"modifiers": "public",
"parameters": "(String query)",
"return": "Iterator<PubmedArticleType>",
"signature": "Iterator<PubmedArticleType> search(String query)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_40 | {
"fields": [
{
"declarator": "LOG = getLogger(MongoCollectionRemoverTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(MongoCollectionRemoverTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_mongodb/src/test/java/ch/epfl/bbp/uima/mongo/MongoCollectionRemoverTest.java",
"identifier": "MongoCollectionRemoverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test() throws Exception {\n\n\t\tString[] conn = MongoTest.getTestConn(\"MongoCollectionRemoverTest\");\n\t\tLOG.debug(\"using conn {}\", conn);\n\n\t\tLOG.debug(\"PUT SOME INITIAL DATA, WITH TOKENS\");\n\t\tJCas jCas = getTestCas();\n\t\tsetDocId(jCas, 17);\n\t\tPipelineBuilder pO = new JcasPipelineBuilder(jCas);\n\t\tpO.add(NaiveSentenceSplitterAnnotator.class);\n\t\tpO.add(WhitespaceTokenizerAnnotator.class);\n\t\tpO.add(MongoWriter.class, PARAM_DB_CONNECTION, conn);\n\t\tpO.process();\n\t\tsleep(1000);\n\n\t\tLOG.debug(\"GET AND VERIFIES IT HAS TOKEN ANNOT\");\n\t\tList<JCas> l = asList(createReader(\n\t\t\t\tMongoCollectionReader.class, PARAM_DB_CONNECTION,\n\t\t\t\tconn));\n\t\tassertEquals(1, l.size());\n\t\tjCas = l.get(0);\n\t\tCollection<Token> t = select(jCas, Token.class);\n\t\tassertEquals(24, t.size());\n\n\t\tLOG.debug(\"REMOVE ALL TOKEN ANNOT\");\n\t\tMongoCollectionRemover.removeAnnotations(conn, Token.class.getName());\n\n\t\tLOG.debug(\"GET AGAIN AND TEST IF IT REMOVED ALL TOKENS\");\n\t\tList<JCas> l2 = asList(createReader(\n\t\t\t\tMongoCollectionReader.class, PARAM_DB_CONNECTION,\n\t\t\t\tconn));\n\t\tassertEquals(1, l2.size());\n\t\tjCas = l2.get(0);\n\t\tassertEquals(17, getHeaderIntDocId(jCas));\n\t\tassertFalse(JCasUtil.exists(jCas, Token.class));\n\t}",
"class_method_signature": "MongoCollectionRemoverTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getTestConn",
"debug",
"debug",
"getTestCas",
"setDocId",
"add",
"add",
"add",
"process",
"sleep",
"debug",
"asList",
"createReader",
"assertEquals",
"size",
"get",
"select",
"assertEquals",
"size",
"debug",
"removeAnnotations",
"getName",
"debug",
"asList",
"createReader",
"assertEquals",
"size",
"get",
"assertEquals",
"getHeaderIntDocId",
"assertFalse",
"exists"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n\t\t\t.getLogger(MongoCollectionRemover.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory\n\t\t\t.getLogger(MongoCollectionRemover.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "db_connection",
"modifier": "@ConfigurationParameter(name = PARAM_DB_CONNECTION, mandatory = true, //\n\tdescription = \"host, dbname, collectionname, user, pw\")\n\tprivate",
"original_string": "@ConfigurationParameter(name = PARAM_DB_CONNECTION, mandatory = true, //\n\tdescription = \"host, dbname, collectionname, user, pw\")\n\tprivate String[] db_connection;",
"type": "String[]",
"var_name": "db_connection"
},
{
"declarator": "coll",
"modifier": "private",
"original_string": "private DBCollection coll;",
"type": "DBCollection",
"var_name": "coll"
},
{
"declarator": "cur",
"modifier": "private",
"original_string": "private DBCursor cur;",
"type": "DBCursor",
"var_name": "cur"
},
{
"declarator": "PARAM_DELETE_ANNOTATIONS = \"delete_annotations\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_DELETE_ANNOTATIONS = \"delete_annotations\";",
"type": "String",
"var_name": "PARAM_DELETE_ANNOTATIONS"
},
{
"declarator": "annotationsToDelete",
"modifier": "@ConfigurationParameter(name = PARAM_DELETE_ANNOTATIONS, mandatory = true)\n\tprivate",
"original_string": "@ConfigurationParameter(name = PARAM_DELETE_ANNOTATIONS, mandatory = true)\n\tprivate String[] annotationsToDelete;",
"type": "String[]",
"var_name": "annotationsToDelete"
},
{
"declarator": "keysToDelete",
"modifier": "private",
"original_string": "private Set<String> keysToDelete;",
"type": "Set<String>",
"var_name": "keysToDelete"
}
],
"file": "modules/bluima_mongodb/src/main/java/ch/epfl/bbp/uima/mongo/MongoCollectionRemover.java",
"identifier": "MongoCollectionRemover",
"interfaces": "",
"methods": [
{
"class_method_signature": "MongoCollectionRemover.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "MongoCollectionRemover.hasNext()",
"constructor": false,
"full_signature": "@Override public boolean hasNext()",
"identifier": "hasNext",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean hasNext()",
"testcase": false
},
{
"class_method_signature": "MongoCollectionRemover.getNext(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void getNext(JCas jCas)",
"identifier": "getNext",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void getNext(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "MongoCollectionRemover.getProgress()",
"constructor": false,
"full_signature": "@Override public Progress[] getProgress()",
"identifier": "getProgress",
"modifiers": "@Override public",
"parameters": "()",
"return": "Progress[]",
"signature": "Progress[] getProgress()",
"testcase": false
},
{
"class_method_signature": "MongoCollectionRemover.removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"constructor": false,
"full_signature": "public static void removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"identifier": "removeAnnotations",
"modifiers": "public static",
"parameters": "(String[] conn,\n\t\t\tString... annotationsToDelete)",
"return": "void",
"signature": "void removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"testcase": false
}
],
"superclass": "extends JCasCollectionReader_ImplBase"
} | {
"body": "public static void removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete) throws UIMAException, IOException {\n\t\tCollectionReader cr = createReader(\n\t\t\t\tMongoCollectionRemover.class, PARAM_DB_CONNECTION,\n\t\t\t\tconn, PARAM_DELETE_ANNOTATIONS, annotationsToDelete);\n\t\tAnalysisEngine noAE = AnalysisEngineFactory\n\t\t\t\t.createEngine(StatsAnnotatorPlus.class);\n\t\tSimplePipeline.runPipeline(cr, noAE);\n\t\tLOG.debug(\"done removing annotations\");\n\t}",
"class_method_signature": "MongoCollectionRemover.removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"constructor": false,
"full_signature": "public static void removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"identifier": "removeAnnotations",
"invocations": [
"createReader",
"createEngine",
"runPipeline",
"debug"
],
"modifiers": "public static",
"parameters": "(String[] conn,\n\t\t\tString... annotationsToDelete)",
"return": "void",
"signature": "void removeAnnotations(String[] conn,\n\t\t\tString... annotationsToDelete)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_17 | {
"fields": [
{
"declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())",
"modifier": "static final",
"original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());",
"type": "IteratorWithPrevious<String>",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\"",
"modifier": "final static",
"original_string": "final static String TEST_PARSE_ROOT = LauncherTest.TESTS_ROOT\n + \"pipeline_parser/\";",
"type": "String",
"var_name": "TEST_PARSE_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/PipelineScriptParserTest.java",
"identifier": "PipelineScriptParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseAe() throws Exception {\n Pipeline p = new Pipeline();\n PipelineScriptParser.parseAE(\"ae: \"\n + WhitespaceTokenizerAnnotator.class.getName(), EMPTY_ARGS, p);\n }",
"class_method_signature": "PipelineScriptParserTest.testParseAe()",
"constructor": false,
"full_signature": "@Test public void testParseAe()",
"identifier": "testParseAe",
"invocations": [
"parseAE",
"getName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAe()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(PipelineScriptParser.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java",
"identifier": "PipelineScriptParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(File scriptFile, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(File scriptFile, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(File scriptFile, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"constructor": false,
"full_signature": "public static Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parse(List<String> scriptLines,\n String parentFilePath, List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"constructor": false,
"full_signature": "private static Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"identifier": "parseAndDispatch",
"modifiers": "private static",
"parameters": "(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"return": "Pipeline",
"signature": "Pipeline parseAndDispatch(List<String> scriptLines,\n Pipeline pipeline, String parentFilePath,\n List<String> replacementVars)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseMaxErrors(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseMaxErrors(String current, Pipeline pipeline)",
"identifier": "parseMaxErrors",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseMaxErrors(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseThreads(String current, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseThreads(String current, Pipeline pipeline)",
"identifier": "parseThreads",
"modifiers": "private static",
"parameters": "(String current, Pipeline pipeline)",
"return": "void",
"signature": "void parseThreads(String current, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parsePython",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parsePython(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseJava",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseJava(IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"constructor": false,
"full_signature": "private static void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"identifier": "parseInclude",
"modifiers": "private static",
"parameters": "(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"return": "void",
"signature": "void parseInclude(String line, Pipeline pipeline,\n String parentFilePath, List<String> cliArgs)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"constructor": false,
"full_signature": "private static void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"identifier": "parseAEJava",
"modifiers": "private static",
"parameters": "(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"return": "void",
"signature": "void parseAEJava(String line,\n IteratorWithPrevious<String> it, Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") private static void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseCR",
"modifiers": "@SuppressWarnings(\"unchecked\") private static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseCR(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.validateParams(List<Object> params, Class<?> classz)",
"constructor": false,
"full_signature": "private static void validateParams(List<Object> params, Class<?> classz)",
"identifier": "validateParams",
"modifiers": "private static",
"parameters": "(List<Object> params, Class<?> classz)",
"return": "void",
"signature": "void validateParams(List<Object> params, Class<?> classz)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseParams(\n IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"identifier": "parseParams",
"modifiers": "static",
"parameters": "(\n IteratorWithPrevious<String> it)",
"return": "Pair<List<Object>, String>",
"signature": "Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it)",
"testcase": false
},
{
"class_method_signature": "PipelineScriptParser.parseNextLines(IteratorWithPrevious<String> it)",
"constructor": false,
"full_signature": "private static String parseNextLines(IteratorWithPrevious<String> it)",
"identifier": "parseNextLines",
"modifiers": "private static",
"parameters": "(IteratorWithPrevious<String> it)",
"return": "String",
"signature": "String parseNextLines(IteratorWithPrevious<String> it)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@SuppressWarnings(\"unchecked\")\n static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline) throws ParseException {\n LOG.info(\"+-parsing line '{}'\", line);\n\n String aeName = line.replaceFirst(\"ae: \", \"\").trim();\n if (aeName.endsWith(\".xml\")) {\n File aeXml = new File(aeName.replaceAll(\"\\\\$ROOT\",\n BlueUima.BLUE_UIMA_ROOT));\n if (!aeXml.exists())\n throw new ParseException(\"no xml descriptor found at \"\n + aeXml.getAbsolutePath(), -1);\n\n Pair<List<Object>, String> params = parseParams(it);\n\n // create ae\n try {\n pipeline.addAe(createEngineDescriptionFromPath(\n aeXml.getAbsolutePath(), params.getKey().toArray()));\n } catch (Exception e) {\n throw new ParseException(\n \"could not instantiate CollectionReader, error: \"\n + e.getMessage(), -1);\n }\n\n } else {\n\n if (aeName.endsWith(\".class\"))\n aeName = aeName.substring(0, aeName.length() - 6);\n\n // instantiate class\n Class<? extends AnalysisComponent> classz = null;\n // first prefix is for exact match, then 1st fallback is the generic\n // package name, then 2nd fallback correspond to packages\n // in bluima_utils\n String[] prefixes = { \"\", \"ch.epfl.bbp.uima.ae.\",\n \"ch.epfl.bbp.uima.ae.output.\",\n \"ch.epfl.bbp.uima.ae.cleanup.\" };\n String tried = \"\";\n for (String prefix : prefixes) {\n\n try {\n tried += prefix + aeName + \" \";\n classz = (Class<? extends AnalysisComponent>) Class\n .forName(prefix + aeName);\n break;\n } catch (Exception e1) {// nope\n }\n }\n if (classz == null)\n throw new ParseException(\"no class found on classpath: \"\n + aeName + \", tried: \" + tried, -1);\n\n Pair<List<Object>, String> params = parseParams(it);\n validateParams(params.getKey(), classz);\n\n // create ae\n try {\n AnalysisEngineDescription aed = AnalysisEngineFactory\n .createEngineDescription(classz, params.getKey()\n .toArray());\n pipeline.addAe(aed);\n\n } catch (ResourceInitializationException e) {\n throw new ParseException(\n \"could not instantiate CollectionReader, error: \"\n + e.getMessage(), -1);\n }\n }\n }",
"class_method_signature": "PipelineScriptParser.parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"identifier": "parseAE",
"invocations": [
"info",
"trim",
"replaceFirst",
"endsWith",
"replaceAll",
"exists",
"getAbsolutePath",
"parseParams",
"addAe",
"createEngineDescriptionFromPath",
"getAbsolutePath",
"toArray",
"getKey",
"getMessage",
"endsWith",
"substring",
"length",
"forName",
"parseParams",
"validateParams",
"getKey",
"createEngineDescription",
"toArray",
"getKey",
"addAe",
"getMessage"
],
"modifiers": "@SuppressWarnings(\"unchecked\") static",
"parameters": "(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"return": "void",
"signature": "void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_6 | {
"fields": [],
"file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/PmcNxmlParserTest.java",
"identifier": "PmcNxmlParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\t@Ignore\n\tpublic void testMatMet() throws Exception {\n\n\t\tArticle article = new PmcNxmlParser().parse(new FileInputStream(\n\t\t\t\tnew File(XmlHelper.XML_TEST_RESOURCES + \"nxml/18446507.nxml\")));\n\n\t\tBody body = article.getBody();\n\t\tif (body != null) {\n\t\t\tfor (Sec sec : body.getSec()) {\n\t\t\t\tSystem.out.println(sec.getSecType()+\"\\t\"+sec.getTitle().getContent().toString());\n\t\t\t}\n\t\t}\n\t}",
"class_method_signature": "PmcNxmlParserTest.testMatMet()",
"constructor": false,
"full_signature": "@Test @Ignore public void testMatMet()",
"identifier": "testMatMet",
"invocations": [
"parse",
"getBody",
"getSec",
"println",
"getSecType",
"toString",
"getContent",
"getTitle"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void testMatMet()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PmcNxmlParser.class)",
"modifier": "",
"original_string": "Logger LOG = LoggerFactory.getLogger(PmcNxmlParser.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "unmarshaller",
"modifier": "private",
"original_string": "private Unmarshaller unmarshaller;",
"type": "Unmarshaller",
"var_name": "unmarshaller"
},
{
"declarator": "xmlReader",
"modifier": "private",
"original_string": "private XMLReader xmlReader;",
"type": "XMLReader",
"var_name": "xmlReader"
},
{
"declarator": "jcSingelton = null",
"modifier": "private static",
"original_string": "private static JAXBContext jcSingelton = null;",
"type": "JAXBContext",
"var_name": "jcSingelton"
}
],
"file": "modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/PmcNxmlParser.java",
"identifier": "PmcNxmlParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PmcNxmlParser.getSingleton()",
"constructor": false,
"full_signature": "private JAXBContext getSingleton()",
"identifier": "getSingleton",
"modifiers": "private",
"parameters": "()",
"return": "JAXBContext",
"signature": "JAXBContext getSingleton()",
"testcase": false
},
{
"class_method_signature": "PmcNxmlParser.PmcNxmlParser()",
"constructor": true,
"full_signature": "public PmcNxmlParser()",
"identifier": "PmcNxmlParser",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PmcNxmlParser()",
"testcase": false
},
{
"class_method_signature": "PmcNxmlParser.parse(InputStream is)",
"constructor": false,
"full_signature": "public Article parse(InputStream is)",
"identifier": "parse",
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "Article",
"signature": "Article parse(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Article parse(InputStream is) throws FileNotFoundException,\n\t\t\tJAXBException {\n\t\ttry {\n\t\t\tInputSource inputSource = new InputSource(new InputStreamReader(is));\n\t\t\tSAXSource source = new SAXSource(xmlReader, inputSource);\n\n\t\t\treturn (Article) unmarshaller.unmarshal(source);\n\t\t} finally {\n\t\t\tIOUtils.closeQuietly(is);\n\t\t}\n\t}",
"class_method_signature": "PmcNxmlParser.parse(InputStream is)",
"constructor": false,
"full_signature": "public Article parse(InputStream is)",
"identifier": "parse",
"invocations": [
"unmarshal",
"closeQuietly"
],
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "Article",
"signature": "Article parse(InputStream is)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_71 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDoesntContainNonexistantNode() {\n assertFalse(trie.contains(\"apple\"));\n }",
"class_method_signature": "RadixTreeImplTest.testDoesntContainNonexistantNode()",
"constructor": false,
"full_signature": "@Test public void testDoesntContainNonexistantNode()",
"identifier": "testDoesntContainNonexistantNode",
"invocations": [
"assertFalse",
"contains"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDoesntContainNonexistantNode()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean contains(String key) {\n Visitor<T, Boolean> visitor = new VisitorImpl<T,Boolean>(Boolean.FALSE) {\n public void visit(String key, RadixTreeNode<T> parent,\n RadixTreeNode<T> node) {\n result = node.isReal();\n }\n };\n\n visit(key, visitor);\n\n return visitor.getResult().booleanValue();\n }",
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"invocations": [
"isReal",
"visit",
"booleanValue",
"getResult"
],
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_26 | {
"fields": [],
"file": "modules/bluima_pdf/src/test/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemoverTest.java",
"identifier": "HyphenRemoverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDehyphenate() {\n assertEquals(\"Not yet implemented\\n\",\n dehyphenate(\"Not yet implem-\\nented\", \"a\"));\n\n assertEquals(\"Not yet implemented\\n\",\n dehyphenate(\"Not yet implem-\\nented\", \"a\"));\n\n assertEquals(\"Not implemented\\n\\nfor now\\n\",\n dehyphenate(\"Not implemented\\n\\nfor now\", \"a\"));\n\n assertEquals(\"Not implemented\\n--\\nfor now\\n\",\n dehyphenate(\"Not implemented\\n--\\nfor now\", \"a\"));\n\n assertEquals(\"Not implemented\\nAA\\nfor now\\n\",\n dehyphenate(\"Not implemented\\nAA\\nfor now\", \"a\"));\n }",
"class_method_signature": "HyphenRemoverTest.testDehyphenate()",
"constructor": false,
"full_signature": "@Test public void testDehyphenate()",
"identifier": "testDehyphenate",
"invocations": [
"assertEquals",
"dehyphenate",
"assertEquals",
"dehyphenate",
"assertEquals",
"dehyphenate",
"assertEquals",
"dehyphenate",
"assertEquals",
"dehyphenate"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDehyphenate()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HyphenRemover.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(HyphenRemover.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "patternHyphen = Pattern\n .compile(\"[\\\\u002D\\\\u00AD\\\\u2010]\\\\s*$\")",
"modifier": "public static final",
"original_string": "public static final Pattern patternHyphen = Pattern\n .compile(\"[\\\\u002D\\\\u00AD\\\\u2010]\\\\s*$\");",
"type": "Pattern",
"var_name": "patternHyphen"
},
{
"declarator": "WORD_SEPARATOR = \"\\\\W+\"",
"modifier": "private static final",
"original_string": "private static final String WORD_SEPARATOR = \"\\\\W+\";",
"type": "String",
"var_name": "WORD_SEPARATOR"
},
{
"declarator": "numberEnd = Pattern.compile(\"[0-9]-$\")",
"modifier": "private static final",
"original_string": "private static final Pattern numberEnd = Pattern.compile(\"[0-9]-$\");",
"type": "Pattern",
"var_name": "numberEnd"
},
{
"declarator": "numberStart = Pattern.compile(\"^[0-9]\")",
"modifier": "private static final",
"original_string": "private static final Pattern numberStart = Pattern.compile(\"^[0-9]\");",
"type": "Pattern",
"var_name": "numberStart"
},
{
"declarator": "greekEnd = Pattern.compile(\"\\\\p{InGreek}-$\")",
"modifier": "private static final",
"original_string": "private static final Pattern greekEnd = Pattern.compile(\"\\\\p{InGreek}-$\");",
"type": "Pattern",
"var_name": "greekEnd"
},
{
"declarator": "greekStart = Pattern.compile(\"^\\\\p{InGreek}+\")",
"modifier": "private static final",
"original_string": "private static final Pattern greekStart = Pattern.compile(\"^\\\\p{InGreek}+\");",
"type": "Pattern",
"var_name": "greekStart"
}
],
"file": "modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemover.java",
"identifier": "HyphenRemover",
"interfaces": "",
"methods": [
{
"class_method_signature": "HyphenRemover.shouldDehyphenate(String w1, String w2)",
"constructor": false,
"full_signature": "private static boolean shouldDehyphenate(String w1, String w2)",
"identifier": "shouldDehyphenate",
"modifiers": "private static",
"parameters": "(String w1, String w2)",
"return": "boolean",
"signature": "boolean shouldDehyphenate(String w1, String w2)",
"testcase": false
},
{
"class_method_signature": "HyphenRemover.dehyphenate(LineNumberReader reader, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(LineNumberReader reader, String docId)",
"identifier": "dehyphenate",
"modifiers": "public static",
"parameters": "(LineNumberReader reader, String docId)",
"return": "String",
"signature": "String dehyphenate(LineNumberReader reader, String docId)",
"testcase": false
},
{
"class_method_signature": "HyphenRemover.dehyphenate(String text, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(String text, String docId)",
"identifier": "dehyphenate",
"modifiers": "public static",
"parameters": "(String text, String docId)",
"return": "String",
"signature": "String dehyphenate(String text, String docId)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String dehyphenate(LineNumberReader reader, String docId) {\n\n String line;\n StringBuilder sb = new StringBuilder();\n\n try {\n while ((line = reader.readLine()) != null) {\n String lineOut = line;\n Matcher matcher = patternHyphen.matcher(line);\n\n // Allows to append consecutive lines with hyphens\n while (matcher.find() && ((line = reader.readLine()) != null)) {\n String behind[] = lineOut.split(WORD_SEPARATOR);\n String forward[] = line.trim().split(WORD_SEPARATOR);\n\n if (behind.length == 0) {\n lineOut = lineOut + \"\\n\" + line;\n continue;\n }\n\n String w1 = behind[(behind.length) - 1];\n String w2 = forward[0];\n if (shouldDehyphenate(w1, w2)) {\n // Remove hyphen from first line and concatenates second\n lineOut = lineOut.substring(0, lineOut.length() - 1)\n .trim() + line.trim();\n } else {\n // just concanates the two lines\n lineOut = lineOut + line;\n }\n matcher = patternHyphen.matcher(lineOut);\n }\n\n sb.append(lineOut.trim());\n sb.append(\"\\n\");\n }\n } catch (Throwable t) {\n //TODO happens sometimes, e.g. docId 1279669\n LOG.warn(\"failed to dehyphenate, docId \" + docId, print(t)); \n }\n return sb.toString();\n }",
"class_method_signature": "HyphenRemover.dehyphenate(LineNumberReader reader, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(LineNumberReader reader, String docId)",
"identifier": "dehyphenate",
"invocations": [
"readLine",
"matcher",
"find",
"readLine",
"split",
"split",
"trim",
"shouldDehyphenate",
"trim",
"substring",
"length",
"trim",
"matcher",
"append",
"trim",
"append",
"warn",
"print",
"toString"
],
"modifiers": "public static",
"parameters": "(LineNumberReader reader, String docId)",
"return": "String",
"signature": "String dehyphenate(LineNumberReader reader, String docId)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_30 | {
"fields": [],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/WordnetAnnotatorTest.java",
"identifier": "WordnetAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n JCas jcas = getTokenizedTestCas(\"rhinoceroses\");\n\n AnalysisEngine ae = createEngine(WordnetAnnotator.class);\n ae.process(jcas);\n\n Collection<WordnetDictTerm> w = select(jcas, WordnetDictTerm.class);\n Prin.t(w);\n assertEquals(1, w.size());\n }",
"class_method_signature": "WordnetAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getTokenizedTestCas",
"createEngine",
"process",
"select",
"t",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(WordnetAnnotator.class)",
"modifier": "private static",
"original_string": "private static org.slf4j.Logger LOG = LoggerFactory\n .getLogger(WordnetAnnotator.class);",
"type": "org.slf4j.Logger",
"var_name": "LOG"
},
{
"declarator": "dictFile",
"modifier": "@ConfigurationParameter(name = BlueUima.PARAM_MODEL_FILE, //\n description = \"dict file from Wordnet\", mandatory = false)\n private",
"original_string": "@ConfigurationParameter(name = BlueUima.PARAM_MODEL_FILE, //\n description = \"dict file from Wordnet\", mandatory = false)\n private String dictFile;",
"type": "String",
"var_name": "dictFile"
},
{
"declarator": "dict",
"modifier": "private",
"original_string": "private RAMDictionary dict;",
"type": "RAMDictionary",
"var_name": "dict"
},
{
"declarator": "stemmer",
"modifier": "private",
"original_string": "private WordnetStemmer stemmer;",
"type": "WordnetStemmer",
"var_name": "stemmer"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/WordnetAnnotator.java",
"identifier": "WordnetAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "WordnetAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "WordnetAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "WordnetAnnotator.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n for (Token t : JCasUtil.select(jCas, Token.class)) {\n try {\n\n if (t.getPos() != null\n && POS.getPartOfSpeech(t.getPos().charAt(0)) != null) {\n POS pos = POS.getPartOfSpeech(t.getPos().charAt(0));\n List<String> stems = stemmer.findStems(t.getCoveredText(),\n pos);\n if (!stems.isEmpty()) {\n IIndexWord wnWord = dict\n .getIndexWord(stems.get(0), pos);\n if (wnWord != null) {\n WordnetDictTerm wdt = new WordnetDictTerm(jCas,\n t.getBegin(), t.getEnd());\n wdt.setDictCanon(stems.get(0));\n wdt.setEntityId(wnWord.getID().toString());\n wdt.addToIndexes();\n }\n }\n } else { // indep. of POS (tries them all)\n for (POS pos : POS.values()) {\n List<String> stems = stemmer.findStems(\n t.getCoveredText(), pos);\n if (!stems.isEmpty()) {\n IIndexWord wnWord = dict.getIndexWord(stems.get(0),\n pos);\n if (wnWord != null) {\n WordnetDictTerm wdt = new WordnetDictTerm(jCas,\n t.getBegin(), t.getEnd());\n wdt.setDictCanon(stems.get(0));\n wdt.setEntityId(wnWord.getID().toString());\n wdt.addToIndexes();\n }\n }\n }\n }\n\n } catch (Throwable tr) {\n LOG.debug(\"Wordnet exception while processing >\"\n + t.getCoveredText() + \"< [\" + t.getBegin() + \":\"\n + t.getEnd() + \"] from doc \" + getHeaderDocId(jCas));\n }\n }\n }",
"class_method_signature": "WordnetAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"select",
"getPos",
"getPartOfSpeech",
"charAt",
"getPos",
"getPartOfSpeech",
"charAt",
"getPos",
"findStems",
"getCoveredText",
"isEmpty",
"getIndexWord",
"get",
"getBegin",
"getEnd",
"setDictCanon",
"get",
"setEntityId",
"toString",
"getID",
"addToIndexes",
"values",
"findStems",
"getCoveredText",
"isEmpty",
"getIndexWord",
"get",
"getBegin",
"getEnd",
"setDictCanon",
"get",
"setEntityId",
"toString",
"getID",
"addToIndexes",
"debug",
"getCoveredText",
"getBegin",
"getEnd",
"getHeaderDocId"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_67 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDuplicatesNotAllowed() {\n RadixTreeImpl<String> trie = new RadixTreeImpl<String>();\n\n trie.insert(\"apple\", \"apple\");\n\n try {\n trie.insert(\"apple\", \"apple2\");\n fail(\"Duplicate should not have been allowed\");\n } catch (DuplicateKeyException e) {\n assertEquals(\"Duplicate key: 'apple'\", e.getMessage());\n }\n }",
"class_method_signature": "RadixTreeImplTest.testDuplicatesNotAllowed()",
"constructor": false,
"full_signature": "@Test public void testDuplicatesNotAllowed()",
"identifier": "testDuplicatesNotAllowed",
"invocations": [
"insert",
"insert",
"fail",
"assertEquals",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDuplicatesNotAllowed()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void insert(String key, T value) throws DuplicateKeyException {\n try {\n\t\t\tinsert(key, root, value);\n\t\t} catch (DuplicateKeyException e) {\n\t\t\t// re-throw the exception with 'key' in the message\n\t\t\tthrow new DuplicateKeyException(\"Duplicate key: '\" + key + \"'\");\n\t\t}\n size++;\n }",
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"invocations": [
"insert"
],
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_126 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/MapUtilsTest.java",
"identifier": "MapUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortByValue() {\n Random random = new Random(System.currentTimeMillis());\n Map<String, Integer> testMap = new HashMap<String, Integer>(1000);\n for (int i = 0; i < 1000; ++i) {\n testMap.put(\"SomeString\" + random.nextInt(), random.nextInt());\n }\n\n testMap = MapUtils.sortByValue(testMap);\n assertEquals(1000, testMap.size());\n\n Integer previous = null;\n for (Map.Entry<String, Integer> entry : testMap.entrySet()) {\n assertNotNull(entry.getValue());\n if (previous != null) {\n assertTrue(entry.getValue() >= previous);\n }\n previous = entry.getValue();\n }\n }",
"class_method_signature": "MapUtilsTest.testSortByValue()",
"constructor": false,
"full_signature": "@Test public void testSortByValue()",
"identifier": "testSortByValue",
"invocations": [
"currentTimeMillis",
"put",
"nextInt",
"nextInt",
"sortByValue",
"assertEquals",
"size",
"entrySet",
"assertNotNull",
"getValue",
"assertTrue",
"getValue",
"getValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSortByValue()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/MapUtils.java",
"identifier": "MapUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapUtils.keyOfHighestValue(Map<K, V> map)",
"constructor": false,
"full_signature": "public static K keyOfHighestValue(Map<K, V> map)",
"identifier": "keyOfHighestValue",
"modifiers": "public static",
"parameters": "(Map<K, V> map)",
"return": "K",
"signature": "K keyOfHighestValue(Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN, final boolean reverse)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map, final boolean reverse)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, final boolean reverse)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(\n Map<K, V> map) {\n return sortByValue(map, false);\n }",
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"invocations": [
"sortByValue"
],
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_88 | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"modifier": "",
"original_string": "String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"type": "String",
"var_name": "haystack"
}
],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelperTest.java",
"identifier": "LuceneHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimilarity2() {\n \n Map<Integer, String> queries = newHashMap();\n queries.put(\n 1,\n \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\");\n queries.put(2, \"This is remarkably good book on graphical models\");\n queries.put(3, \"This is remarkably good book on models\");\n queries.put(4, \"what a mistake to go fishing last saturday\");\n \n Map<Integer, Float> similarities = LuceneHelper.computeSimilarity2(\n queries, \"This is a remarkably good book on graphical models\", 3);\n \n float s1 = similarities.get(1), s2 = similarities.get(2), s3 = similarities\n .get(3), s4 = similarities.get(4);\n LOG.debug(\"\\ns1 {}\\ns2 {}\\ns3 {}\\ns4 {}\",\n new Object[] { s1, s2, s3, s4 });\n \n assertTrue(\"we have a match\", s1 > 0);\n assertTrue(\"we have a match\", s2 > 0);\n assertTrue(\"we have a match\", s3 > 0);\n assertTrue(\"no match\", s4 == 0);\n \n assertTrue(s2 > s1);\n assertTrue(s2 > s3);\n }",
"class_method_signature": "LuceneHelperTest.testSimilarity2()",
"constructor": false,
"full_signature": "@Test public void testSimilarity2()",
"identifier": "testSimilarity2",
"invocations": [
"newHashMap",
"put",
"put",
"put",
"put",
"computeSimilarity2",
"get",
"get",
"get",
"get",
"debug",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSimilarity2()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelper.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CONTENT_FIELD = \"text\"",
"modifier": "private static final",
"original_string": "private static final String CONTENT_FIELD = \"text\";",
"type": "String",
"var_name": "CONTENT_FIELD"
},
{
"declarator": "ID_FIELD = \"id\"",
"modifier": "private static final",
"original_string": "private static final String ID_FIELD = \"id\";",
"type": "String",
"var_name": "ID_FIELD"
},
{
"declarator": "anal = new StandardAnalyzer(Version.LUCENE_41)",
"modifier": "private static final",
"original_string": "private static final Analyzer anal = new StandardAnalyzer(Version.LUCENE_41);",
"type": "Analyzer",
"var_name": "anal"
},
{
"declarator": "parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal)",
"modifier": "private static final",
"original_string": "private static final QueryParser parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal);",
"type": "QueryParser",
"var_name": "parser"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelper.java",
"identifier": "LuceneHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength) {\n\n if (queries == null || queries.isEmpty() || haystack == null\n || haystack.length() == 0)\n return null;\n\n try {\n // index the cleaned text\n RAMDirectory idx = new RAMDirectory();\n IndexWriterConfig iwc = new IndexWriterConfig(LUCENE_41, anal);\n IndexWriter writer = new IndexWriter(idx, iwc);\n\n // index\n Document doc = new Document();\n doc.add(new TextField(CONTENT_FIELD, haystack, Store.YES));\n writer.addDocument(doc);\n writer.close();\n\n // search\n Map<Integer, Float> ret = newHashMap();\n IndexReader reader = open(idx);\n for (Entry<Integer, String> query : queries.entrySet()) {\n Query q = parser.parse(getNGram(\n query.getValue().replaceAll(\"[^A-Za-z0-9]\", \" \")\n .replaceAll(\" +\", \" \"), gramLength));\n // less discriminative\n // Query q = parser.parse(query.getValue()\n // .replaceAll(\"[^A-Za-z0-9]\", \" \").replaceAll(\" +\", \" \"));\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs results = searcher.search(q, 1);\n if (results.totalHits == 1)\n ret.put(query.getKey(), results.getMaxScore());\n else\n ret.put(query.getKey(), 0f);\n }\n reader.close();\n\n return ret;\n\n } catch (Exception e) {\n LOG.warn(\"could not computeSimilarity\", e);\n }\n return null;\n }",
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"invocations": [
"isEmpty",
"length",
"add",
"addDocument",
"close",
"newHashMap",
"open",
"entrySet",
"parse",
"getNGram",
"replaceAll",
"replaceAll",
"getValue",
"search",
"put",
"getKey",
"getMaxScore",
"put",
"getKey",
"close",
"warn"
],
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_10 | {
"fields": [
{
"declarator": "LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\"",
"modifier": "public static final",
"original_string": "public static final String LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\";",
"type": "String",
"var_name": "LAUNCHER_ROOT"
},
{
"declarator": "TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH",
"modifier": "public static final",
"original_string": "public static final String TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH;",
"type": "String",
"var_name": "TESTS_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/LauncherTest.java",
"identifier": "LauncherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBeanshell() throws Exception {\n Launcher.main(new String[] { TESTS_ROOT + \"laucher/beanshell.pipeline\" });\n }",
"class_method_signature": "LauncherTest.testBeanshell()",
"constructor": false,
"full_signature": "@Test public void testBeanshell()",
"identifier": "testBeanshell",
"invocations": [
"main"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBeanshell()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Launcher.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Launcher.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "OK_MESSAGE = \"Pipeline completed successfully :-)\"",
"modifier": "public static final",
"original_string": "public static final String OK_MESSAGE = \"Pipeline completed successfully :-)\";",
"type": "String",
"var_name": "OK_MESSAGE"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java",
"identifier": "Launcher",
"interfaces": "",
"methods": [
{
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
},
{
"class_method_signature": "Launcher.listPipelinesAndAsk(File pipelines)",
"constructor": false,
"full_signature": "public static void listPipelinesAndAsk(File pipelines)",
"identifier": "listPipelinesAndAsk",
"modifiers": "public static",
"parameters": "(File pipelines)",
"return": "void",
"signature": "void listPipelinesAndAsk(File pipelines)",
"testcase": false
},
{
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void main(String[] args) throws IOException, UIMAException,\n ParseException {\n\n // no pipeline --> list and ask\n if (args == null || args.length == 0) {\n String home = System.getProperty(\"basedir\");\n listPipelinesAndAsk(new File(home + \"/pipelines\"));\n }\n\n // pipeline provided --> run it\n else if (args.length > 0) {\n\n List<String> cliArgs = new ArrayList<String>();\n for (int i = 1; i < args.length; i++) {\n cliArgs.add(args[i]);\n }\n runPipeline(new File(args[0]), cliArgs);\n }\n\n else {\n System.err.println(\"Please provide a script file\");\n }\n }",
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"invocations": [
"getProperty",
"listPipelinesAndAsk",
"add",
"runPipeline",
"println"
],
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_106 | {
"fields": [],
"file": "utils/mallet_utils/src/test/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformersTest.java",
"identifier": "CommonNerTokenTransformersTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMorphologyContiguousNumbersGroupedOrRejectedTransformer() {\n\t\tTokenTransformer transformer = \n\t\t\t\tCommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer();\n\t\t\n\t\tassertEquals(null, transformer.transform(\"\"));\n\t\tassertEquals(null, transformer.transform(\"miau\"));\n\t\tassertEquals(null, transformer.transform(\"GnRH\"));\n\t\tassertEquals(\"s*\", transformer.transform(\"s2\"));\n\t\tassertEquals(\"rp*phox\", transformer.transform(\"rp47phox\"));\n\t\tassertEquals(\"u*\", transformer.transform(\"U937\"));\n\t\tassertEquals(\"u*k*\", transformer.transform(\"U23k9\"));\n\t\tassertEquals(null, transformer.transform(\".\"));\n\t}",
"class_method_signature": "CommonNerTokenTransformersTest.testMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "@Test public void testMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "testMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"invocations": [
"getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": true
} | {
"fields": [
{
"declarator": "ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "ToLowerCaseTransformer"
},
{
"declarator": "morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumber"
},
{
"declarator": "morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumberNonContiguous"
},
{
"declarator": "morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyContiguousNumbersGroupedOrRejected"
},
{
"declarator": "englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "englishVowelsTransformer"
}
],
"file": "utils/mallet_utils/src/main/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformers.java",
"identifier": "CommonNerTokenTransformers",
"interfaces": "",
"methods": [
{
"class_method_signature": "CommonNerTokenTransformers.getLowerCaseTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getLowerCaseTransformer()",
"identifier": "getLowerCaseTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getLowerCaseTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"identifier": "getMorphologyUpperLowerNumberTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.removeEqualContiguous(String in)",
"constructor": false,
"full_signature": "private static final String removeEqualContiguous(String in)",
"identifier": "removeEqualContiguous",
"modifiers": "private static final",
"parameters": "(String in)",
"return": "String",
"signature": "String removeEqualContiguous(String in)",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "getMorphologyUpperLowerNumberNonContiguousTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getEnglishVowelsTransformer()",
"identifier": "getEnglishVowelsTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getEnglishVowelsTransformer()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer() {\n\t\treturn morphologyContiguousNumbersGroupedOrRejected;\n\t}",
"class_method_signature": "CommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"invocations": [],
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_47 | {
"fields": [
{
"declarator": "testDir",
"modifier": "private static",
"original_string": "private static String testDir;",
"type": "String",
"var_name": "testDir"
}
],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/cr/ZipXmiCollectionReaderTest.java",
"identifier": "ZipXmiCollectionReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testStructured() throws Exception {\n\n for (int docId : new int[] { 12345678, 1234, 12345 }) {\n\n JCas jCas = UimaTests.getTestCas(\"bla blahh \" + docId);\n Header header = new Header(jCas);\n header.setDocId(docId + \"\");\n header.addToIndexes();\n\n AnalysisEngine serializer = createEngine(ZipXWriter.class,\n BlueUima.PARAM_OUTPUT_DIR, testDir,\n ZipXWriter.PARAM_FILE_NAMER_CLASS_NAME,\n HeaderDocIdFileNamer.class.getName(),\n ZipXWriter.PARAM_STRUCTURE_DIR, true);\n SimplePipeline.runPipeline(jCas, serializer);\n\n File newFile = new File(testDir, StructuredDirectory.getFilePath(\n docId, \"xmi.zip\"));\n assertTrue(newFile.exists());\n\n JCas newJCas = JCasFactory.createJCas();\n ZipXmiCollectionReader.deserialize(newFile, newJCas, ZipXmiCollectionReader.XMI);\n assertEquals(\"contents should match\", \"bla blahh \" + docId,\n newJCas.getDocumentText());\n }\n }",
"class_method_signature": "ZipXmiCollectionReaderTest.testStructured()",
"constructor": false,
"full_signature": "@Test public void testStructured()",
"identifier": "testStructured",
"invocations": [
"getTestCas",
"setDocId",
"addToIndexes",
"createEngine",
"getName",
"runPipeline",
"getFilePath",
"assertTrue",
"exists",
"createJCas",
"deserialize",
"assertEquals",
"getDocumentText"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testStructured()",
"testcase": true
} | {
"fields": [
{
"declarator": "XMI = \"XMI\"",
"modifier": "public static final",
"original_string": "public static final String XMI = \"XMI\";",
"type": "String",
"var_name": "XMI"
},
{
"declarator": "XCAS = \"XCAS\"",
"modifier": "public static final",
"original_string": "public static final String XCAS = \"XCAS\";",
"type": "String",
"var_name": "XCAS"
},
{
"declarator": "PARAM_XML_SCHEME = \"xmlSchemeName\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_XML_SCHEME = \"xmlSchemeName\";",
"type": "String",
"var_name": "PARAM_XML_SCHEME"
},
{
"declarator": "xmlScheme",
"modifier": "@ConfigurationParameter(name = PARAM_XML_SCHEME, defaultValue = \"XMI\", //\n description = \"specifies the UIMA XML serialization scheme that should be used. \"\n + \"Valid values for this parameter are 'XMI' and 'XCAS'\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_XML_SCHEME, defaultValue = \"XMI\", //\n description = \"specifies the UIMA XML serialization scheme that should be used. \"\n + \"Valid values for this parameter are 'XMI' and 'XCAS'\")\n private String xmlScheme;",
"type": "String",
"var_name": "xmlScheme"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/cr/ZipXmiCollectionReader.java",
"identifier": "ZipXmiCollectionReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZipXmiCollectionReader.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "ZipXmiCollectionReader.getNext(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void getNext(JCas jCas)",
"identifier": "getNext",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void getNext(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "ZipXmiCollectionReader.deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"constructor": false,
"full_signature": "public static void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"identifier": "deserialize",
"modifiers": "public static",
"parameters": "(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"return": "void",
"signature": "void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"testcase": false
}
],
"superclass": "extends AbstractFileReader"
} | {
"body": "public static void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme) throws IOException {\n\n InputStream inputStream = unzipUniqueFileAsStream(currentZipFile);\n try {\n if (_xmlScheme.equals(XMI))\n XmiCasDeserializer.deserialize(inputStream, jCas.getCas());\n else\n XCASDeserializer.deserialize(inputStream, jCas.getCas());\n } catch (SAXException e) {\n throw new IOException(e);\n } finally {\n inputStream.close();\n }\n }",
"class_method_signature": "ZipXmiCollectionReader.deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"constructor": false,
"full_signature": "public static void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"identifier": "deserialize",
"invocations": [
"unzipUniqueFileAsStream",
"equals",
"deserialize",
"getCas",
"deserialize",
"getCas",
"close"
],
"modifiers": "public static",
"parameters": "(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"return": "void",
"signature": "void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_110 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/io/LineReaderTest.java",
"identifier": "LineReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadLines() throws Exception {\n\n List<String> theints = LineReader.linesFrom(LineReader.class\n .getResourceAsStream(\"LineReader_ints.txt\"));\n assertEquals(4, theints.size());\n assertEquals(\"1\", theints.get(0));\n assertEquals(\"2\", theints.get(1));\n assertEquals(\"3\", theints.get(2));\n assertEquals(\"1\", theints.get(3));\n }",
"class_method_signature": "LineReaderTest.testReadLines()",
"constructor": false,
"full_signature": "@Test public void testReadLines()",
"identifier": "testReadLines",
"invocations": [
"linesFrom",
"getResourceAsStream",
"assertEquals",
"size",
"assertEquals",
"get",
"assertEquals",
"get",
"assertEquals",
"get",
"assertEquals",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testReadLines()",
"testcase": true
} | {
"fields": [
{
"declarator": "reader",
"modifier": "private",
"original_string": "private BufferedReader reader;",
"type": "BufferedReader",
"var_name": "reader"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/io/LineReader.java",
"identifier": "LineReader",
"interfaces": "implements Iterable<String>, Closeable",
"methods": [
{
"class_method_signature": "LineReader.LineReader(InputStream stream)",
"constructor": true,
"full_signature": "public LineReader(InputStream stream)",
"identifier": "LineReader",
"modifiers": "public",
"parameters": "(InputStream stream)",
"return": "",
"signature": " LineReader(InputStream stream)",
"testcase": false
},
{
"class_method_signature": "LineReader.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "LineReader.getText(String separator)",
"constructor": false,
"full_signature": "public String getText(String separator)",
"identifier": "getText",
"modifiers": "public",
"parameters": "(String separator)",
"return": "String",
"signature": "String getText(String separator)",
"testcase": false
},
{
"class_method_signature": "LineReader.asText(File f)",
"constructor": false,
"full_signature": "public static String asText(File f)",
"identifier": "asText",
"modifiers": "public static",
"parameters": "(File f)",
"return": "String",
"signature": "String asText(File f)",
"testcase": false
},
{
"class_method_signature": "LineReader.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "LineReader.finalize()",
"constructor": false,
"full_signature": "@Override protected void finalize()",
"identifier": "finalize",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void finalize()",
"testcase": false
},
{
"class_method_signature": "LineReader.iterator()",
"constructor": false,
"full_signature": "@Override public Iterator<String> iterator()",
"identifier": "iterator",
"modifiers": "@Override public",
"parameters": "()",
"return": "Iterator<String>",
"signature": "Iterator<String> iterator()",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(String filePath)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(String filePath)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(String filePath)",
"return": "List<String>",
"signature": "List<String> linesFrom(String filePath)",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(InputStream is)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "List<String>",
"signature": "List<String> linesFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(String file)",
"constructor": false,
"full_signature": "public static int[] intsFrom(String file)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "int[]",
"signature": "int[] intsFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(InputStream is)",
"constructor": false,
"full_signature": "public static int[] intsFrom(InputStream is)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "int[]",
"signature": "int[] intsFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(String file)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(String file)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "double[]",
"signature": "double[] doublesFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(InputStream is)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "double[]",
"signature": "double[] doublesFrom(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<String> linesFrom(String filePath)\n throws FileNotFoundException {\n return linesFrom(new FileInputStream(filePath));\n }",
"class_method_signature": "LineReader.linesFrom(String filePath)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(String filePath)",
"identifier": "linesFrom",
"invocations": [
"linesFrom"
],
"modifiers": "public static",
"parameters": "(String filePath)",
"return": "List<String>",
"signature": "List<String> linesFrom(String filePath)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_51 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2Test.java",
"identifier": "WriteCoocurrencesToLoadfile2Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSnippet() throws Exception {\n\n JCas jCas = getTokenizedTestCas(\"Test sentence for snippetting great\");\n Protein a1 = createAnnot(jCas, Protein.class, 5, 13);\n Protein a2 = createAnnot(jCas, Protein.class, 18, 29);\n\n String snippet = snippet(jCas, 2, 32, a1, a2);\n assertEquals(\n \"st <strong class=\\\"Protein\\\">sentence</strong> for <strong class=\\\"Protein\\\">snippetting</strong> gr\",\n snippet);\n\n snippet = snippet(jCas, 2, 32, a2, a1);\n assertEquals(\n \"a2 then a1\",\n \"st <strong class=\\\"Protein\\\">sentence</strong> for <strong class=\\\"Protein\\\">snippetting</strong> gr\",\n snippet);\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2Test.testSnippet()",
"constructor": false,
"full_signature": "@Test public void testSnippet()",
"identifier": "testSnippet",
"invocations": [
"getTokenizedTestCas",
"createAnnot",
"createAnnot",
"snippet",
"assertEquals",
"snippet",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSnippet()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "NULL = \"NULL\"",
"modifier": "private static final",
"original_string": "private static final String NULL = \"NULL\";",
"type": "String",
"var_name": "NULL"
},
{
"declarator": "outputFile",
"modifier": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected String outputFile;",
"type": "String",
"var_name": "outputFile"
},
{
"declarator": "annot1Type",
"modifier": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected String annot1Type;",
"type": "String",
"var_name": "annot1Type"
},
{
"declarator": "annot2Type",
"modifier": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected String annot2Type;",
"type": "String",
"var_name": "annot2Type"
},
{
"declarator": "cooccurrenceType",
"modifier": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected String cooccurrenceType;",
"type": "String",
"var_name": "cooccurrenceType"
},
{
"declarator": "writeSnippet",
"modifier": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected boolean writeSnippet;",
"type": "boolean",
"var_name": "writeSnippet"
},
{
"declarator": "writer",
"modifier": "protected",
"original_string": "protected LoadDataFileWriter writer;",
"type": "LoadDataFileWriter",
"var_name": "writer"
},
{
"declarator": "cooccCnt = 0",
"modifier": "protected",
"original_string": "protected int cooccCnt = 0;",
"type": "int",
"var_name": "cooccCnt"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2.java",
"identifier": "WriteCoocurrencesToLoadfile2",
"interfaces": "",
"methods": [
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.process(JCas jCas)",
"constructor": false,
"full_signature": "public void process(JCas jCas)",
"identifier": "process",
"modifiers": "public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"identifier": "snippet",
"modifiers": "public static",
"parameters": "(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"return": "String",
"signature": "String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public static String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2) {\n\n final String T_BEGIN = \"<strong class=\\\"\";\n final String T_END = \"</strong>\";\n\n String s = jCas.getDocumentText().substring(snippetBegin, snippetEnd);\n String sError = s;\n\n try {\n\n int relA1Begin = a1.getBegin() - snippetBegin;\n int relA1End = a1.getEnd() - snippetBegin;\n int relA2Begin = a2.getBegin() - snippetBegin;\n int relA2End = a2.getEnd() - snippetBegin;\n\n // highlight\n Position position = BlueCasUtil.isBefore(a1, a2);\n if (position == Position.before) {\n // start w/ a2 (at the end)\n s = s.substring(0, relA2End) + T_END + s.substring(relA2End);\n s = s.substring(0, relA2Begin) + T_BEGIN\n + a2.getClass().getSimpleName() + \"\\\">\"\n + s.substring(relA2Begin);\n // now with a1\n s = s.substring(0, relA1End) + T_END + s.substring(relA1End);\n s = s.substring(0, relA1Begin) + T_BEGIN\n + a1.getClass().getSimpleName() + \"\\\">\"\n + s.substring(relA1Begin);\n\n } else if (position == Position.after) {\n // start w/ a1 (at the end)\n s = s.substring(0, relA1End) + T_END + s.substring(relA1End);\n s = s.substring(0, relA1Begin) + T_BEGIN\n + a1.getClass().getSimpleName() + \"\\\">\"\n + s.substring(relA1Begin);\n // now with a2\n s = s.substring(0, relA2End) + T_END + s.substring(relA2End);\n s = s.substring(0, relA2Begin) + T_BEGIN\n + a2.getClass().getSimpleName() + \"\\\">\"\n + s.substring(relA2Begin);\n\n } else {// overlap LATER\n LOG.warn(\n \"don't know how to highlight snippet that overlaps '{}' and '{}', pmid:{}\"\n + getHeaderDocId(jCas), a1.getCoveredText(),\n a2.getCoveredText());\n }\n\n return s.replaceAll(\"[\\r\\t\\n]\", \"\");\n\n } catch (Exception e) {\n LOG.warn(\n \"Could not extract snippet on pmid {} beg {} end {} a1 {} a2 {}\",\n new Object[] { getHeaderDocId(jCas), snippetBegin,\n snippetEnd, To.string(a1), To.string(a2) });\n return sError;\n }\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2.snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"identifier": "snippet",
"invocations": [
"substring",
"getDocumentText",
"getBegin",
"getEnd",
"getBegin",
"getEnd",
"isBefore",
"substring",
"substring",
"substring",
"getSimpleName",
"getClass",
"substring",
"substring",
"substring",
"substring",
"getSimpleName",
"getClass",
"substring",
"substring",
"substring",
"substring",
"getSimpleName",
"getClass",
"substring",
"substring",
"substring",
"substring",
"getSimpleName",
"getClass",
"substring",
"warn",
"getHeaderDocId",
"getCoveredText",
"getCoveredText",
"replaceAll",
"warn",
"getHeaderDocId",
"string",
"string"
],
"modifiers": "public static",
"parameters": "(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"return": "String",
"signature": "String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_92 | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(AbbreviationsExpanderAnnotatorTest.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory\n .getLogger(AbbreviationsExpanderAnnotatorTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_abbreviations/src/test/java/ch/epfl/bbp/uima/ae/AbbreviationsExpanderAnnotatorTest.java",
"identifier": "AbbreviationsExpanderAnnotatorTest",
"interfaces": "",
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Test\n public void testAbrevs() throws Exception {\n\n JCas jCas = getTestCas(SAMPLE_TXT);\n\n PipelineBuilder p = new JcasPipelineBuilder(jCas);\n p.add(AbbreviationsExpanderAnnotatorTest.class);\n p.add(AbbreviationsAnnotator.class);\n p.add(AbbreviationsExpanderAnnotator.class);\n p.process();\n\n Collection<Abbreviation> abrevs = select(jCas, Abbreviation.class);\n for (Abbreviation abrev : abrevs) {\n LOG.debug(To.string(abrev));\n }\n assertEquals(15, abrevs.size());\n\n List<Protein> prots = newArrayList(select(jCas, Protein.class));\n for (Protein prot : prots)\n LOG.debug(To.string(prot));\n assertEquals(6, prots.size());\n\n // set by ForTestingAnnotator\n // Protein[glutamic acid decarboxylase]val:dummyNameToTestClone;id:null\n // Protein[calbindin]val:dummyNameToTestClone;id:null\n // Protein[dysplasia]val:dummyNameToTestClone;id:null\n\n // set by AbrevexpanderAnnotator\n // Protein[GAD]val:dummyNameToTestClone;id:null\n // Protein[CB]val:dummyNameToTestClone;id:null\n // Protein[CB]val:dummyNameToTestClone;id:null\n }",
"class_method_signature": "AbbreviationsExpanderAnnotatorTest.testAbrevs()",
"constructor": false,
"full_signature": "@Test public void testAbrevs()",
"identifier": "testAbrevs",
"invocations": [
"getTestCas",
"add",
"add",
"add",
"process",
"select",
"debug",
"string",
"assertEquals",
"size",
"newArrayList",
"select",
"debug",
"string",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAbrevs()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(AbbreviationsExpanderAnnotator.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = LoggerFactory\n .getLogger(AbbreviationsExpanderAnnotator.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_abbreviations/src/main/java/ch/epfl/bbp/uima/ae/AbbreviationsExpanderAnnotator.java",
"identifier": "AbbreviationsExpanderAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbbreviationsExpanderAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "AbbreviationsExpanderAnnotator.expandAbbreviations(JCas jCas)",
"constructor": false,
"full_signature": "public static void expandAbbreviations(JCas jCas)",
"identifier": "expandAbbreviations",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void expandAbbreviations(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "AbbreviationsExpanderAnnotator.getCovered(JCas jCas, Abbreviation aRef,\n String pmId)",
"constructor": false,
"full_signature": "private static List<Annotation> getCovered(JCas jCas, Abbreviation aRef,\n String pmId)",
"identifier": "getCovered",
"modifiers": "private static",
"parameters": "(JCas jCas, Abbreviation aRef,\n String pmId)",
"return": "List<Annotation>",
"signature": "List<Annotation> getCovered(JCas jCas, Abbreviation aRef,\n String pmId)",
"testcase": false
},
{
"class_method_signature": "AbbreviationsExpanderAnnotator.selectMatching(CAS cas, final int begin,\n final int end, AnnotationFS annotationCloseToTheRegion)",
"constructor": false,
"full_signature": "private static List<Annotation> selectMatching(CAS cas, final int begin,\n final int end, AnnotationFS annotationCloseToTheRegion)",
"identifier": "selectMatching",
"modifiers": "private static",
"parameters": "(CAS cas, final int begin,\n final int end, AnnotationFS annotationCloseToTheRegion)",
"return": "List<Annotation>",
"signature": "List<Annotation> selectMatching(CAS cas, final int begin,\n final int end, AnnotationFS annotationCloseToTheRegion)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n expandAbbreviations(jCas);\n }",
"class_method_signature": "AbbreviationsExpanderAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"expandAbbreviations"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_84 | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"modifier": "",
"original_string": "String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"type": "String",
"var_name": "haystack"
}
],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelperTest.java",
"identifier": "LuceneHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n\n String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";\n float s = LuceneHelper.subsumes(haystack, //\n \"This is a remarkably good book on graphical models\");\n LOG.debug(\"score {}\", s);\n assertTrue(s > 0.1);\n\n s = subsumes(haystack, \"This is remarkably good book on models\");\n LOG.debug(\"score {}\", s);\n assertTrue(s > 0.1);\n\n s = subsumes(haystack, \"what a mistake to go fishing last saturday\");\n assertTrue(s == 0.0);\n\n s = subsumes(\"\", \"what a mistake to go fishing last saturday\");\n assertTrue(s == 0.0);\n }",
"class_method_signature": "LuceneHelperTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"subsumes",
"debug",
"assertTrue",
"subsumes",
"debug",
"assertTrue",
"subsumes",
"assertTrue",
"subsumes",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelper.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CONTENT_FIELD = \"text\"",
"modifier": "private static final",
"original_string": "private static final String CONTENT_FIELD = \"text\";",
"type": "String",
"var_name": "CONTENT_FIELD"
},
{
"declarator": "ID_FIELD = \"id\"",
"modifier": "private static final",
"original_string": "private static final String ID_FIELD = \"id\";",
"type": "String",
"var_name": "ID_FIELD"
},
{
"declarator": "anal = new StandardAnalyzer(Version.LUCENE_41)",
"modifier": "private static final",
"original_string": "private static final Analyzer anal = new StandardAnalyzer(Version.LUCENE_41);",
"type": "Analyzer",
"var_name": "anal"
},
{
"declarator": "parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal)",
"modifier": "private static final",
"original_string": "private static final QueryParser parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal);",
"type": "QueryParser",
"var_name": "parser"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelper.java",
"identifier": "LuceneHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static float subsumes(String haystack, final String needle) {\n\n if (needle == null || needle.length() < 0 || haystack == null\n || haystack.length() < 0)\n return 0f;\n\n try {\n // index the cleaned text\n RAMDirectory idx = new RAMDirectory();\n IndexWriterConfig iwc = new IndexWriterConfig(LUCENE_41, anal);\n IndexWriter writer = new IndexWriter(idx, iwc);\n\n // index\n Document doc = new Document();\n doc.add(new TextField(CONTENT_FIELD, haystack, Store.YES));\n writer.addDocument(doc);\n writer.close();\n\n // search\n IndexReader reader = open(idx);\n Query query = parser.parse(getNGram(needle, 3));\n TopDocs results = new IndexSearcher(reader).search(query, 1);\n float score = 0;\n for (ScoreDoc hit : results.scoreDocs) {\n score += hit.score;\n }\n reader.close();\n idx.close();\n return score;\n\n } catch (Exception e) {\n LOG.warn(\"could not computeSimilarity for \" + needle, e);\n }\n return 0f;\n }",
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"invocations": [
"length",
"length",
"add",
"addDocument",
"close",
"open",
"parse",
"getNGram",
"search",
"close",
"close",
"warn"
],
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_85 | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"modifier": "",
"original_string": "String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"type": "String",
"var_name": "haystack"
}
],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelperTest.java",
"identifier": "LuceneHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test733() {\n\n String haystack = \"Neurotransmitters and Temperature Regulation \\nPETER LOMAX AND MARTIN DAVID GREEN\\n\\nDepartment of Pharmacology, School of Medicine and the Brain Research Institute, University of\\n California, Los Angeles, Calif. 90024 ( U . S . A . ) \\nThe demonstration of relatively high concentrations of amines in the hypothalamus,\\ncoupled with the elucidation of the role of this region of the brain in regulating body\\ntemperature have suggested that these amines might play an important role as neuro-\\ntransmitters in thermoregulation. Over the past decade or so there has been a con-\\nsiderable body of research aimed at resolving these questions and several recent\\nsymposia have adequately reviewed this work (Bligh and Moore, 1972; Schonbaum\\nandLomax,1973;Lomaxetal.,1975).Itisnotpossible,atthepresenttime,tocon-\\nstruct any unified view or general theory of the function of neurotransmitters in\\nthermoregulatory mechanisms; although integrative models have frequently been\\nproposed, such as those of Bligh (1972) or Myers (1975), these more often represent\\nspecial cases arising from the author's own research rather than a synthesis of all\\navailable data.\\n Many attempts have been made to describe the thermorzgulatory system in terms\\nof cybernetic models of varying complexity (Hardy, 1972). The next step in the analysis\\nof the system has been to propose neuronal networks to replace the black boxes,\\nbased on experimental evidences (Hensel, 1973). One of the major controversies\\nconcerns the nature of the reference point of the controller - the presence or absence\\nof a temperature independent reference signal. Two major models can be derived:\\none in which the controlled temperature is compared to a reference value (the “set-\\npoint”) and appropriate responses are activated to correct any deviation of the\\ncontrolled temperature from the reference; alternatively, two types of sensors can be\\npostulated, responding to a deviation above or below the controlled temperature, the\\nfeedbacks from these are compared and appropriate responses to correct the load\\nerror are set in motion (Mitchell et al., 1972; Horowitz, 1975; Houdas and Guieu,\\n1975). Schematic illustrations of these alterations are seen in Fig. 1. Whatever the\\ndetailed nature of the controller, or its precise anatomical location, the net effect of\\nits activity will be integrated to increase or decrease the frequency of firing of the\\nthermoregulatory effector neurons. Whether or not an individual neuron does fire at\\nany instant is a function of its membrane potential and this, in turn, will depend on\\nthe actions of excitatory and inhibitory influences on it.\\n It is in this last respect that the major problems arise in relation to the role of the\\nvarious neurotransmitters in that one cannot define the exact point in the neuronal\\nloop at which the amine is acting in most studies. Thus, modification of neuro-\\nReferencesP. 259-261\";\n String needle = \"Neurotransmitters and temperature (regulation).\";\n float s = LuceneHelper.subsumes(haystack, needle);\n LOG.debug(\"score {}\", s);\n\n haystack = \"Neurotransmitters and Temperature Regulation \\nPETER LOMAX AND MARTIN DAVID GREEN\\n\\nDepartment of Pharmacology, School of Medicine and the Brain Research Institute, University of\\n California, Los Angeles, Calif. 90024 ( U . S . A . ) \\nThe demonstration of relatively high concentrations of amines in the hypothalamus,\\ncoupled with the elucidation of the role of this region of the brain in regulating body\\ntemperature have suggested that these amines might play an important role as neuro-\\ntransmitters in thermoregulation. Over the past decade or so there has been a con-\\nsiderable body of research aimed at resolving these questions and several recent\\nsymposia have adequately reviewed this work (Bligh and Moore, 1972; Schonbaum\\nandLomax,1973;Lomaxetal.,1975).Itisnotpossible,atthepresenttime,tocon-\\nstruct any unified view or general theory of the function of neurotransmitters in\\nthermoregulatory mechanisms; although integrative models have frequently been\\nproposed, such as those of Bligh (1972) or Myers (1975), these more often represent\\nspecial cases arising from the author's own research rather than a synthesis of all\\navailable data.\\n Many attempts have been made to describe the thermorzgulatory system in terms\\nof cybernetic models of varying complexity (Hardy, 1972). The next step in the analysis\\nof the system has been to propose neuronal networks to replace the black boxes,\\nbased on experimental evidences (Hensel, 1973). One of the major controversies\\nconcerns the nature of the reference point of the controller - the presence or absence\\nof a temperature independent reference signal. Two major models can be derived:\\none in which the controlled temperature is compared to a reference value (the “set-\\npoint”) and appropriate responses are activated to correct any deviation of the\\ncontrolled temperature from the reference; alternatively, two types of sensors can be\\npostulated, responding to a deviation above or below the controlled temperature, the\\nfeedbacks from these are compared and appropriate responses to correct the load\\nerror are set in motion (Mitchell et al., 1972; Horowitz, 1975; Houdas and Guieu,\\n1975). Schematic illustrations of these alterations are seen in Fig. 1. Whatever the\\ndetailed nature of the controller, or its precise anatomical location, the net effect of\\nits activity will be integrated to increase or decrease the frequency of firing of the\\nthermoregulatory effector neurons. Whether or not an individual neuron does fire at\\nany instant is a function of its membrane potential and this, in turn, will depend on\\nthe actions of excitatory and inhibitory influences on it.\\n It is in this last respect that the major problems arise in relation to the role of the\\nvarious neurotransmitters in that one cannot define the exact point in the neuronal\\nloop at which the amine is acting in most studies. Thus, modification of neuro-\\nReferencesP. 259-261\";\n needle = \"Neurotransmitters and lorax regulation.\";\n s = LuceneHelper.subsumes(haystack, needle);\n LOG.debug(\"score {}\", s);\n }",
"class_method_signature": "LuceneHelperTest.test733()",
"constructor": false,
"full_signature": "@Test public void test733()",
"identifier": "test733",
"invocations": [
"subsumes",
"debug",
"subsumes",
"debug"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test733()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelper.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CONTENT_FIELD = \"text\"",
"modifier": "private static final",
"original_string": "private static final String CONTENT_FIELD = \"text\";",
"type": "String",
"var_name": "CONTENT_FIELD"
},
{
"declarator": "ID_FIELD = \"id\"",
"modifier": "private static final",
"original_string": "private static final String ID_FIELD = \"id\";",
"type": "String",
"var_name": "ID_FIELD"
},
{
"declarator": "anal = new StandardAnalyzer(Version.LUCENE_41)",
"modifier": "private static final",
"original_string": "private static final Analyzer anal = new StandardAnalyzer(Version.LUCENE_41);",
"type": "Analyzer",
"var_name": "anal"
},
{
"declarator": "parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal)",
"modifier": "private static final",
"original_string": "private static final QueryParser parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal);",
"type": "QueryParser",
"var_name": "parser"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelper.java",
"identifier": "LuceneHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static float subsumes(String haystack, final String needle) {\n\n if (needle == null || needle.length() < 0 || haystack == null\n || haystack.length() < 0)\n return 0f;\n\n try {\n // index the cleaned text\n RAMDirectory idx = new RAMDirectory();\n IndexWriterConfig iwc = new IndexWriterConfig(LUCENE_41, anal);\n IndexWriter writer = new IndexWriter(idx, iwc);\n\n // index\n Document doc = new Document();\n doc.add(new TextField(CONTENT_FIELD, haystack, Store.YES));\n writer.addDocument(doc);\n writer.close();\n\n // search\n IndexReader reader = open(idx);\n Query query = parser.parse(getNGram(needle, 3));\n TopDocs results = new IndexSearcher(reader).search(query, 1);\n float score = 0;\n for (ScoreDoc hit : results.scoreDocs) {\n score += hit.score;\n }\n reader.close();\n idx.close();\n return score;\n\n } catch (Exception e) {\n LOG.warn(\"could not computeSimilarity for \" + needle, e);\n }\n return 0f;\n }",
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"invocations": [
"length",
"length",
"add",
"addDocument",
"close",
"open",
"parse",
"getNGram",
"search",
"close",
"close",
"warn"
],
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_93 | {
"fields": [
{
"declarator": "pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\"",
"modifier": "final static",
"original_string": "final static String pmId16196030 = \"This paper describes the quantitative areal and laminar distribution of identified neuron populations projecting from areas of prefrontal cortex (PFC) to subcortical autonomic, motor, and limbic sites in the rat. Injections of the retrograde pathway tracer wheat germ agglutinin conjugated with horseradish peroxidase (WGA-HRP) were made into dorsal/ventral striatum (DS/VS), basolateral amygdala (BLA), mediodorsal thalamus (MD), lateral hypothalamus (LH), mediolateral septum, dorsolateral periaqueductal gray, dorsal raphe, ventral tegmental area, parabrachial nucleus, nucleus tractus solitarius, rostral/caudal ventrolateral medulla, or thoracic spinal cord (SC). High-resolution flat-map density distributions of retrogradely labelled neurons indicated that specific PFC regions were differentially involved in the projections studied, with medial (m)PFC divided into dorsal and ventral sectors. The percentages that WGA-HRP retrogradely labelled neurons composed of the projection neurons in individual layers of infralimbic (IL; area 25) prelimbic (PL; area 32), and dorsal anterior cingulate (ACd; area 24b) cortices were calculated. Among layer 5 pyramidal cells, approximately 27.4% in IL/PL/ACd cortices projected to LH, 22.9% in IL/ventral PL to VS, 18.3% in ACd/dorsal PL to DS, and 8.1% in areas IL/PL to BLA; and 37% of layer 6 pyramidal cells in IL/PL/ACd projected to MD. Data for other projection pathways are given. Multiple dual retrograde fluorescent tracing studies indicated that moderate populations (<9%) of layer 5 mPFC neurons projected to LH/VS, LH/SC, or VS/BLA. The data provide new quantitative information concerning the density and distribution of neurons involved in identified projection pathways from defined areas of the rat PFC to specific subcortical targets involved in dynamic goal-directed behavior.\";",
"type": "String",
"var_name": "pmId16196030"
}
],
"file": "modules/bluima_abbreviations/src/test/java/ch/epfl/bbp/uima/AbbreviationExpanderTest.java",
"identifier": "AbbreviationExpanderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShouldNotExpand() throws Exception {\n\n String txt = \"The subthalamic nucleus (STh) is a brain region. The medialSTh is here.\";\n assertEquals(\n \"should not expand, since Sth is glued to medial\",\n \"The subthalamic nucleus is a brain region. The medialSTh is here.\",\n expand(txt));\n txt = \"The subthalamic nucleus (STh) is a brain region. The medial SThis here.\";\n assertEquals(\n \"should not expand, since Sth is glued to is\",\n \"The subthalamic nucleus is a brain region. The medial SThis here.\",\n expand(txt));\n }",
"class_method_signature": "AbbreviationExpanderTest.testShouldNotExpand()",
"constructor": false,
"full_signature": "@Test public void testShouldNotExpand()",
"identifier": "testShouldNotExpand",
"invocations": [
"assertEquals",
"expand",
"assertEquals",
"expand"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testShouldNotExpand()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(AbbreviationExpander.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG = getLogger(AbbreviationExpander.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "model = null",
"modifier": "private static",
"original_string": "private static AlignmentPredictionModel model = null;",
"type": "AlignmentPredictionModel",
"var_name": "model"
}
],
"file": "modules/bluima_abbreviations/src/main/java/ch/epfl/bbp/uima/AbbreviationExpander.java",
"identifier": "AbbreviationExpander",
"interfaces": "",
"methods": [
{
"class_method_signature": "AbbreviationExpander.AbbreviationExpander()",
"constructor": true,
"full_signature": "private AbbreviationExpander()",
"identifier": "AbbreviationExpander",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " AbbreviationExpander()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getModel()",
"constructor": false,
"full_signature": "static private AlignmentPredictionModel getModel()",
"identifier": "getModel",
"modifiers": "static private",
"parameters": "()",
"return": "AlignmentPredictionModel",
"signature": "AlignmentPredictionModel getModel()",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.getAbbrevs(String txt)",
"constructor": false,
"full_signature": "static public Set<Abbrev> getAbbrevs(String txt)",
"identifier": "getAbbrevs",
"modifiers": "static public",
"parameters": "(String txt)",
"return": "Set<Abbrev>",
"signature": "Set<Abbrev> getAbbrevs(String txt)",
"testcase": false
},
{
"class_method_signature": "AbbreviationExpander.expand(String txt, Set<Abbrev> abbrevs)",
"constructor": false,
"full_signature": "static public String expand(String txt, Set<Abbrev> abbrevs)",
"identifier": "expand",
"modifiers": "static public",
"parameters": "(String txt, Set<Abbrev> abbrevs)",
"return": "String",
"signature": "String expand(String txt, Set<Abbrev> abbrevs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static public String expand(String txt) {\n return expand(txt, getAbbrevs(txt));\n }",
"class_method_signature": "AbbreviationExpander.expand(String txt)",
"constructor": false,
"full_signature": "static public String expand(String txt)",
"identifier": "expand",
"invocations": [
"expand",
"getAbbrevs"
],
"modifiers": "static public",
"parameters": "(String txt)",
"return": "String",
"signature": "String expand(String txt)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_111 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/io/LineReaderTest.java",
"identifier": "LineReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadInts() throws Exception {\n\n int[] theints = LineReader.intsFrom(LineReader.class\n .getResourceAsStream(\"LineReader_ints.txt\"));\n assertEquals(4, theints.length);\n assertEquals(1, theints[0]);\n assertEquals(2, theints[1]);\n assertEquals(3, theints[2]);\n assertEquals(1, theints[3]);\n }",
"class_method_signature": "LineReaderTest.testReadInts()",
"constructor": false,
"full_signature": "@Test public void testReadInts()",
"identifier": "testReadInts",
"invocations": [
"intsFrom",
"getResourceAsStream",
"assertEquals",
"assertEquals",
"assertEquals",
"assertEquals",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testReadInts()",
"testcase": true
} | {
"fields": [
{
"declarator": "reader",
"modifier": "private",
"original_string": "private BufferedReader reader;",
"type": "BufferedReader",
"var_name": "reader"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/io/LineReader.java",
"identifier": "LineReader",
"interfaces": "implements Iterable<String>, Closeable",
"methods": [
{
"class_method_signature": "LineReader.LineReader(InputStream stream)",
"constructor": true,
"full_signature": "public LineReader(InputStream stream)",
"identifier": "LineReader",
"modifiers": "public",
"parameters": "(InputStream stream)",
"return": "",
"signature": " LineReader(InputStream stream)",
"testcase": false
},
{
"class_method_signature": "LineReader.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "LineReader.getText(String separator)",
"constructor": false,
"full_signature": "public String getText(String separator)",
"identifier": "getText",
"modifiers": "public",
"parameters": "(String separator)",
"return": "String",
"signature": "String getText(String separator)",
"testcase": false
},
{
"class_method_signature": "LineReader.asText(File f)",
"constructor": false,
"full_signature": "public static String asText(File f)",
"identifier": "asText",
"modifiers": "public static",
"parameters": "(File f)",
"return": "String",
"signature": "String asText(File f)",
"testcase": false
},
{
"class_method_signature": "LineReader.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "LineReader.finalize()",
"constructor": false,
"full_signature": "@Override protected void finalize()",
"identifier": "finalize",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void finalize()",
"testcase": false
},
{
"class_method_signature": "LineReader.iterator()",
"constructor": false,
"full_signature": "@Override public Iterator<String> iterator()",
"identifier": "iterator",
"modifiers": "@Override public",
"parameters": "()",
"return": "Iterator<String>",
"signature": "Iterator<String> iterator()",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(String filePath)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(String filePath)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(String filePath)",
"return": "List<String>",
"signature": "List<String> linesFrom(String filePath)",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(InputStream is)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "List<String>",
"signature": "List<String> linesFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(String file)",
"constructor": false,
"full_signature": "public static int[] intsFrom(String file)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "int[]",
"signature": "int[] intsFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(InputStream is)",
"constructor": false,
"full_signature": "public static int[] intsFrom(InputStream is)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "int[]",
"signature": "int[] intsFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(String file)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(String file)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "double[]",
"signature": "double[] doublesFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(InputStream is)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "double[]",
"signature": "double[] doublesFrom(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int[] intsFrom(String file) throws FileNotFoundException {\n return intsFrom(new FileInputStream(file));\n }",
"class_method_signature": "LineReader.intsFrom(String file)",
"constructor": false,
"full_signature": "public static int[] intsFrom(String file)",
"identifier": "intsFrom",
"invocations": [
"intsFrom"
],
"modifiers": "public static",
"parameters": "(String file)",
"return": "int[]",
"signature": "int[] intsFrom(String file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_50 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/io/DirectoryIteratorTest.java",
"identifier": "DirectoryIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLarge() throws Exception {\n\n if (IS_OS_LINUX || IS_OS_MAC) {\n\n File dir = Resources.getFile(\"directoryIterator/default\");\n Iterator<File> it = DirectoryIterator.get(\n LargeDirectoryIterator.class.getSimpleName(), dir, null,\n false);\n ArrayList<File> list = newArrayList(it);\n assertEquals(3, list.size());\n assertEquals(\"test\", asText(list.get(0)).substring(0, 4));\n\n it = DirectoryIterator.get(\n LargeDirectoryIterator.class.getSimpleName(), dir, \"tm\",\n false);\n list = newArrayList(it);\n assertEquals(1, list.size());\n }\n }",
"class_method_signature": "DirectoryIteratorTest.testLarge()",
"constructor": false,
"full_signature": "@Test public void testLarge()",
"identifier": "testLarge",
"invocations": [
"getFile",
"get",
"getSimpleName",
"newArrayList",
"assertEquals",
"size",
"assertEquals",
"substring",
"asText",
"get",
"get",
"getSimpleName",
"newArrayList",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testLarge()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(DirectoryIterator.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(DirectoryIterator.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "LARGE = LargeDirectoryIterator.class\n .getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String LARGE = LargeDirectoryIterator.class\n .getSimpleName();",
"type": "String",
"var_name": "LARGE"
},
{
"declarator": "ZIP = ZipDirectoryIterator.class.getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String ZIP = ZipDirectoryIterator.class.getSimpleName();",
"type": "String",
"var_name": "ZIP"
},
{
"declarator": "dir",
"modifier": "protected",
"original_string": "protected File dir;",
"type": "File",
"var_name": "dir"
},
{
"declarator": "extensionFilter = null",
"modifier": "protected",
"original_string": "protected String extensionFilter = null;",
"type": "String",
"var_name": "extensionFilter"
},
{
"declarator": "isRecursive = false",
"modifier": "protected",
"original_string": "protected boolean isRecursive = false;",
"type": "boolean",
"var_name": "isRecursive"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/io/DirectoryIterator.java",
"identifier": "DirectoryIterator",
"interfaces": "",
"methods": [
{
"class_method_signature": "DirectoryIterator.DirectoryIterator()",
"constructor": true,
"full_signature": "public DirectoryIterator()",
"identifier": "DirectoryIterator",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DirectoryIterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setDirectory(File dir)",
"constructor": false,
"full_signature": "public DirectoryIterator setDirectory(File dir)",
"identifier": "setDirectory",
"modifiers": "public",
"parameters": "(File dir)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setDirectory(File dir)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setExtensionFilter(String ext)",
"constructor": false,
"full_signature": "public DirectoryIterator setExtensionFilter(String ext)",
"identifier": "setExtensionFilter",
"modifiers": "public",
"parameters": "(String ext)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setExtensionFilter(String ext)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setRecursive(boolean isRecursive)",
"constructor": false,
"full_signature": "public DirectoryIterator setRecursive(boolean isRecursive)",
"identifier": "setRecursive",
"modifiers": "public",
"parameters": "(boolean isRecursive)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setRecursive(boolean isRecursive)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.iterator()",
"constructor": false,
"full_signature": "public abstract Iterator<File> iterator()",
"identifier": "iterator",
"modifiers": "public abstract",
"parameters": "()",
"return": "Iterator<File>",
"signature": "Iterator<File> iterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive) throws IOException {\n\n try {\n // add package name to e.g. \"DefaultDirectoryIterator\"\n if (directoryIteratorType.indexOf('.') == -1) {\n directoryIteratorType = DirectoryIterator.class.getPackage()\n .getName() + \".\" + directoryIteratorType;\n }\n\n DirectoryIterator it = (DirectoryIterator) Class.forName(\n directoryIteratorType).newInstance();\n it.setDirectory(dir);\n it.setRecursive(recursive);\n\n if (extensionFilter != null)\n it.setExtensionFilter(extensionFilter);\n return it.iterator();\n } catch (Throwable t) {\n throw new IOException(t);\n }\n }",
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"invocations": [
"indexOf",
"getName",
"getPackage",
"newInstance",
"forName",
"setDirectory",
"setRecursive",
"setExtensionFilter",
"iterator"
],
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_107 | {
"fields": [],
"file": "utils/mallet_utils/src/test/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformersTest.java",
"identifier": "CommonNerTokenTransformersTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEnglishVowelsTransformer() {\n\t\tTokenTransformer transformer = \n\t\t\t\tCommonNerTokenTransformers.getEnglishVowelsTransformer();\n\t\t\n\t\tassertEquals(\"\", transformer.transform(\"\"));\n\t\tassertEquals(\"*iau\", transformer.transform(\"miau\"));\n\t\tassertEquals(\"****\", transformer.transform(\"GnRH\"));\n\t\tassertEquals(\"**\", transformer.transform(\"s2\"));\n\t\tassertEquals(\"******o*\", transformer.transform(\"rp47phox\"));\n\t\tassertEquals(\"U***\", transformer.transform(\"U937\"));\n\t\tassertEquals(\"U****\", transformer.transform(\"U23k9\"));\n\t\tassertEquals(\"*\", transformer.transform(\".\"));\n\t}",
"class_method_signature": "CommonNerTokenTransformersTest.testEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "@Test public void testEnglishVowelsTransformer()",
"identifier": "testEnglishVowelsTransformer",
"invocations": [
"getEnglishVowelsTransformer",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testEnglishVowelsTransformer()",
"testcase": true
} | {
"fields": [
{
"declarator": "ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "ToLowerCaseTransformer"
},
{
"declarator": "morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumber"
},
{
"declarator": "morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumberNonContiguous"
},
{
"declarator": "morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyContiguousNumbersGroupedOrRejected"
},
{
"declarator": "englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "englishVowelsTransformer"
}
],
"file": "utils/mallet_utils/src/main/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformers.java",
"identifier": "CommonNerTokenTransformers",
"interfaces": "",
"methods": [
{
"class_method_signature": "CommonNerTokenTransformers.getLowerCaseTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getLowerCaseTransformer()",
"identifier": "getLowerCaseTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getLowerCaseTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"identifier": "getMorphologyUpperLowerNumberTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.removeEqualContiguous(String in)",
"constructor": false,
"full_signature": "private static final String removeEqualContiguous(String in)",
"identifier": "removeEqualContiguous",
"modifiers": "private static final",
"parameters": "(String in)",
"return": "String",
"signature": "String removeEqualContiguous(String in)",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "getMorphologyUpperLowerNumberNonContiguousTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getEnglishVowelsTransformer()",
"identifier": "getEnglishVowelsTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getEnglishVowelsTransformer()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static TokenTransformer getEnglishVowelsTransformer() {\n\t\treturn englishVowelsTransformer;\n\t}",
"class_method_signature": "CommonNerTokenTransformers.getEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getEnglishVowelsTransformer()",
"identifier": "getEnglishVowelsTransformer",
"invocations": [],
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getEnglishVowelsTransformer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_46 | {
"fields": [
{
"declarator": "testDir",
"modifier": "private static",
"original_string": "private static String testDir;",
"type": "String",
"var_name": "testDir"
}
],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/cr/ZipXmiCollectionReaderTest.java",
"identifier": "ZipXmiCollectionReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerializeDeserializeXmi() throws Exception {\n\n CollectionReader cr = createReader(TextArrayReader.class,\n PARAM_INPUT, new String[] { \"this is a test\" });\n AnalysisEngine serializer = createEngine(ZipXWriter.class,\n BlueUima.PARAM_OUTPUT_DIR, testDir + \"/serdeser\");\n SimplePipeline.runPipeline(cr, serializer);\n\n cr = createReader(ZipXmiCollectionReader.class, \n PARAM_INPUT_DIRECTORY, testDir + \"/serdeser\");\n CAS cas = createCas(cr.getProcessingResourceMetaData());\n cr.getNext(cas);\n assertEquals(\"this is a test\", cas.getDocumentText());\n }",
"class_method_signature": "ZipXmiCollectionReaderTest.testSerializeDeserializeXmi()",
"constructor": false,
"full_signature": "@Test public void testSerializeDeserializeXmi()",
"identifier": "testSerializeDeserializeXmi",
"invocations": [
"createReader",
"createEngine",
"runPipeline",
"createReader",
"createCas",
"getProcessingResourceMetaData",
"getNext",
"assertEquals",
"getDocumentText"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSerializeDeserializeXmi()",
"testcase": true
} | {
"fields": [
{
"declarator": "XMI = \"XMI\"",
"modifier": "public static final",
"original_string": "public static final String XMI = \"XMI\";",
"type": "String",
"var_name": "XMI"
},
{
"declarator": "XCAS = \"XCAS\"",
"modifier": "public static final",
"original_string": "public static final String XCAS = \"XCAS\";",
"type": "String",
"var_name": "XCAS"
},
{
"declarator": "PARAM_XML_SCHEME = \"xmlSchemeName\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_XML_SCHEME = \"xmlSchemeName\";",
"type": "String",
"var_name": "PARAM_XML_SCHEME"
},
{
"declarator": "xmlScheme",
"modifier": "@ConfigurationParameter(name = PARAM_XML_SCHEME, defaultValue = \"XMI\", //\n description = \"specifies the UIMA XML serialization scheme that should be used. \"\n + \"Valid values for this parameter are 'XMI' and 'XCAS'\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_XML_SCHEME, defaultValue = \"XMI\", //\n description = \"specifies the UIMA XML serialization scheme that should be used. \"\n + \"Valid values for this parameter are 'XMI' and 'XCAS'\")\n private String xmlScheme;",
"type": "String",
"var_name": "xmlScheme"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/cr/ZipXmiCollectionReader.java",
"identifier": "ZipXmiCollectionReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZipXmiCollectionReader.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "ZipXmiCollectionReader.getNext(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void getNext(JCas jCas)",
"identifier": "getNext",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void getNext(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "ZipXmiCollectionReader.deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"constructor": false,
"full_signature": "public static void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"identifier": "deserialize",
"modifiers": "public static",
"parameters": "(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"return": "void",
"signature": "void deserialize(File currentZipFile, JCas jCas,\n String _xmlScheme)",
"testcase": false
}
],
"superclass": "extends AbstractFileReader"
} | {
"body": "@Override\n public void getNext(JCas jCas) throws IOException, CollectionException {\n File currentZipFile = fileIterator.next();\n deserialize(currentZipFile, jCas, xmlScheme);\n }",
"class_method_signature": "ZipXmiCollectionReader.getNext(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void getNext(JCas jCas)",
"identifier": "getNext",
"invocations": [
"next",
"deserialize"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void getNext(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_11 | {
"fields": [
{
"declarator": "LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\"",
"modifier": "public static final",
"original_string": "public static final String LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\";",
"type": "String",
"var_name": "LAUNCHER_ROOT"
},
{
"declarator": "TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH",
"modifier": "public static final",
"original_string": "public static final String TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH;",
"type": "String",
"var_name": "TESTS_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/LauncherTest.java",
"identifier": "LauncherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testArgs() throws Exception {\n // should not throw an exception\n Launcher.runPipeline(new File(TESTS_ROOT + \"laucher/args.pipeline\"),\n newArrayList(\"two words\", \"2\", \"10\"));\n }",
"class_method_signature": "LauncherTest.testArgs()",
"constructor": false,
"full_signature": "@Test public void testArgs()",
"identifier": "testArgs",
"invocations": [
"runPipeline",
"newArrayList"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testArgs()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Launcher.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Launcher.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "OK_MESSAGE = \"Pipeline completed successfully :-)\"",
"modifier": "public static final",
"original_string": "public static final String OK_MESSAGE = \"Pipeline completed successfully :-)\";",
"type": "String",
"var_name": "OK_MESSAGE"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java",
"identifier": "Launcher",
"interfaces": "",
"methods": [
{
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
},
{
"class_method_signature": "Launcher.listPipelinesAndAsk(File pipelines)",
"constructor": false,
"full_signature": "public static void listPipelinesAndAsk(File pipelines)",
"identifier": "listPipelinesAndAsk",
"modifiers": "public static",
"parameters": "(File pipelines)",
"return": "void",
"signature": "void listPipelinesAndAsk(File pipelines)",
"testcase": false
},
{
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void runPipeline(File scriptFile, List<String> cliArgs)\n throws IOException, UIMAException, ParseException {\n if (!scriptFile.exists()) {\n throw new IOException(\"Script file does not exist (\"\n + scriptFile.getAbsolutePath() + \")\");\n }\n\n LOG.info(\"Parsing pipeline script at '{}'\",\n scriptFile.getAbsolutePath() + \" \\n with CLI parameters: \"\n + join(cliArgs, \", \"));\n Pipeline pipeline = null;\n try {\n pipeline = PipelineScriptParser.parse(scriptFile, cliArgs);\n } catch (ParseException e) {\n throw new ParseException(\"\\nERROR parsing '\" + scriptFile.getName()\n + \"'\\n\" + e.getMessage()\n + \"\\n(see the README.txt for the pipeline script format)\",\n e.getErrorOffset());\n }\n\n LOG.info(\"Successfully parsed pipeline script, now starting pipeline...\");\n LOG.info(\"*************************************************************\");\n pipeline.run();\n // will be printed if no exception.\n // used in pipeline tests, do not change\n System.out.println(OK_MESSAGE);\n }",
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"invocations": [
"exists",
"getAbsolutePath",
"info",
"getAbsolutePath",
"join",
"parse",
"getName",
"getMessage",
"getErrorOffset",
"info",
"info",
"run",
"println"
],
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_66 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInsert() {\n trie.insert(\"apple\", \"apple\");\n trie.insert(\"bat\", \"bat\");\n trie.insert(\"ape\", \"ape\");\n trie.insert(\"bath\", \"bath\");\n trie.insert(\"banana\", \"banana\"); \n \n assertEquals(trie.find(\"apple\"), \"apple\");\n assertEquals(trie.find(\"bat\"), \"bat\");\n assertEquals(trie.find(\"ape\"), \"ape\");\n assertEquals(trie.find(\"bath\"), \"bath\");\n assertEquals(trie.find(\"banana\"), \"banana\");\n }",
"class_method_signature": "RadixTreeImplTest.testInsert()",
"constructor": false,
"full_signature": "@Test public void testInsert()",
"identifier": "testInsert",
"invocations": [
"insert",
"insert",
"insert",
"insert",
"insert",
"assertEquals",
"find",
"assertEquals",
"find",
"assertEquals",
"find",
"assertEquals",
"find",
"assertEquals",
"find"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testInsert()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void insert(String key, T value) throws DuplicateKeyException {\n try {\n\t\t\tinsert(key, root, value);\n\t\t} catch (DuplicateKeyException e) {\n\t\t\t// re-throw the exception with 'key' in the message\n\t\t\tthrow new DuplicateKeyException(\"Duplicate key: '\" + key + \"'\");\n\t\t}\n size++;\n }",
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"invocations": [
"insert"
],
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_127 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/MapUtilsTest.java",
"identifier": "MapUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSortByReverseValue() {\n Random random = new Random(System.currentTimeMillis());\n Map<String, Integer> testMap = new HashMap<String, Integer>(1000);\n for (int i = 0; i < 1000; ++i) {\n testMap.put(\"SomeString\" + random.nextInt(), random.nextInt());\n }\n\n testMap = MapUtils.sortByValue(testMap, true);\n assertEquals(1000, testMap.size());\n\n Integer previous = null;\n for (Map.Entry<String, Integer> entry : testMap.entrySet()) {\n assertNotNull(entry.getValue());\n if (previous != null) {\n assertTrue(entry.getValue() <= previous);\n }\n previous = entry.getValue();\n }\n }",
"class_method_signature": "MapUtilsTest.testSortByReverseValue()",
"constructor": false,
"full_signature": "@Test public void testSortByReverseValue()",
"identifier": "testSortByReverseValue",
"invocations": [
"currentTimeMillis",
"put",
"nextInt",
"nextInt",
"sortByValue",
"assertEquals",
"size",
"entrySet",
"assertNotNull",
"getValue",
"assertTrue",
"getValue",
"getValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSortByReverseValue()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/MapUtils.java",
"identifier": "MapUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapUtils.keyOfHighestValue(Map<K, V> map)",
"constructor": false,
"full_signature": "public static K keyOfHighestValue(Map<K, V> map)",
"identifier": "keyOfHighestValue",
"modifiers": "public static",
"parameters": "(Map<K, V> map)",
"return": "K",
"signature": "K keyOfHighestValue(Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN, final boolean reverse)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map, final boolean reverse)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, final boolean reverse)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(\n Map<K, V> map) {\n return sortByValue(map, false);\n }",
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"invocations": [
"sortByValue"
],
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_89 | {
"fields": [],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedIdTest.java",
"identifier": "Txt2PubmedIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEvaluate() throws IOException {\n\n String base = \"/Volumes/HDD2/ren_data/data_hdd/_papers_etc/pubmed/txt_to_pmid-evaluation_sample/pdfs\";\n\n Txt2PubmedId txt2PubmedId = new Txt2PubmedId(new File(\n Txt2PubmedIdIndexer.INDEX_PATH));\n int highMatch = 0, lowMatch = 0, noMatch = 0, wrongHighMatch = 0, wrongLowMatch = 0;\n\n @SuppressWarnings(\"unchecked\")\n Collection<File> listFiles = listFiles(new File(base),\n new String[] { \"pdf\" }, false);\n for (File pdfF : listFiles) {\n int pmIdGOLD = new Integer(pdfF.getName().replaceAll(\".pdf\", \"\"));\n\n // if (!Lists.newArrayList(16963531, 17004004).contains(pmIdGOLD))\n // continue;\n\n PmId pmId = txt2PubmedId.extract(pdfF);\n\n System.out.print(\"pmid\\t\" + pmIdGOLD + \"\\t\");\n\n if (pmId == null) { // NO MATCH\n System.out.println(\"NO___match\");\n noMatch++;\n\n } else if (pmId.getPmId() == pmIdGOLD) {// RIGHT PREDICTION\n if (pmId.getConfidence().equals(Confidence.HIGH)) {\n System.out.println(\"HIGH_match\");\n highMatch++;\n } else {\n System.out.println(\"LOW__match\");\n lowMatch++;\n }\n } else { // WRONG PREDICTION\n if (pmId.getConfidence().equals(Confidence.HIGH)) {\n System.out.println(\"WRONG_HIGH_match\");\n wrongHighMatch++;\n } else {\n System.out.println(\"WRONG_LOW__match\");\n wrongLowMatch++;\n }\n }\n }\n\n System.out.println(\"highMatch=\" + highMatch);\n System.out.println(\"lowMatch=\" + lowMatch);\n System.out.println(\"noMatch=\" + noMatch);\n System.out.println(\"wrongHighMatch=\" + wrongHighMatch);\n System.out.println(\"wrongLowMatch=\" + wrongLowMatch);\n }",
"class_method_signature": "Txt2PubmedIdTest.testEvaluate()",
"constructor": false,
"full_signature": "@Test public void testEvaluate()",
"identifier": "testEvaluate",
"invocations": [
"listFiles",
"replaceAll",
"getName",
"extract",
"print",
"println",
"getPmId",
"equals",
"getConfidence",
"println",
"println",
"equals",
"getConfidence",
"println",
"println",
"println",
"println",
"println",
"println",
"println"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testEvaluate()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Txt2PubmedId.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(Txt2PubmedId.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "HIGH_CONFIDENCE_THRESHOLD = 5f",
"modifier": "private static final",
"original_string": "private static final float HIGH_CONFIDENCE_THRESHOLD = 5f;",
"type": "float",
"var_name": "HIGH_CONFIDENCE_THRESHOLD"
},
{
"declarator": "LOW_CONFIDENCE_THRESHOLD = 1.6f",
"modifier": "private static final",
"original_string": "private static final float LOW_CONFIDENCE_THRESHOLD = 1.6f;",
"type": "float",
"var_name": "LOW_CONFIDENCE_THRESHOLD"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private QueryParser parser;",
"type": "QueryParser",
"var_name": "parser"
},
{
"declarator": "searcher",
"modifier": "private",
"original_string": "private IndexSearcher searcher;",
"type": "IndexSearcher",
"var_name": "searcher"
},
{
"declarator": "indexReader",
"modifier": "private",
"original_string": "private DirectoryReader indexReader;",
"type": "DirectoryReader",
"var_name": "indexReader"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedId.java",
"identifier": "Txt2PubmedId",
"interfaces": "",
"methods": [
{
"class_method_signature": "Txt2PubmedId.Txt2PubmedId(File indexPath)",
"constructor": true,
"full_signature": "public Txt2PubmedId(File indexPath)",
"identifier": "Txt2PubmedId",
"modifiers": "public",
"parameters": "(File indexPath)",
"return": "",
"signature": " Txt2PubmedId(File indexPath)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.getNGram(String text, int size)",
"constructor": false,
"full_signature": "public static String getNGram(String text, int size)",
"identifier": "getNGram",
"modifiers": "public static",
"parameters": "(String text, int size)",
"return": "String",
"signature": "String getNGram(String text, int size)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public PmId extract(File pdfF) {\n\t\ttry {\n\t\t\t// parse pdf\n\t\t\tJCas jCas = JCasFactory.createJCas();\n\t\t\tPDFTextStream pdf = new PDFTextStream(pdfF);\n\t\t\tBlockHandler blueHandler = new BlockHandler();\n\t\t\tpdf.pipe(blueHandler);\n\t\t\tPdfCollectionReader.extractText(jCas, blueHandler.getDoc(),\n\t\t\t\t\tpdfF.getName(), false);\n\n\t\t\t// crop: only first 2 pages of text\n\t\t\tString txt = \"\";\n\t\t\tfor (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t\tif (block.getPageId() < 2) {\n\t\t\t\t\ttxt += block.getCoveredText() + \" \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO\n\t\t\t// DocumentBlock largestBlock = null;\n\t\t\t// double maxFontSize=-2d;\n\t\t\t// for (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t// if (block.getFontSize() > maxFontSize) {\n\t\t\t// largestBlock=block;\n\t\t\t// }\n\t\t\t// }\n\t\t\t// String largestText = largestBlock.getCoveredText();\n\n\t\t\t// filter: must have minimum text length\n\t\t\tif (txt.length() < 100) {\n\t\t\t\tLOG.debug(\"{}: text too small for extraction (l={}\",\n\t\t\t\t\t\tpdfF.getName(), txt.length());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// cleanup: remove '\"' --> important for building Lucene query later\n\t\t\tString cleanedText = txt.replaceAll(\"[^A-Za-z0-9]\", \" \");\n\t\t\t// cleanup: remove all double spaces\n\t\t\tcleanedText = cleanedText.replaceAll(\" +\", \" \");\n\n\t\t\t// crop: if has \"abstract\", only keep subset\n\t\t\t// int abstractIndexOf =\n\t\t\t// cleanedText.toLowerCase().indexOf(\"abstract\");\n\t\t\t// if (abstractIndexOf > -1) {\n\t\t\t// // / System.out.println(\"abstract\");\n\t\t\t// cleanedText = cleanedText.substring(abstractIndexOf + 8,\n\t\t\t// min(abstractIndexOf + 1500, cleanedText.length()));\n\t\t\t// }\n\t\t\t// crop: if has \"keywords\", only keep subset\n\t\t\t// int keywords = cleanedText.toLowerCase().indexOf(\"keywords\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// } else {\n\t\t\t// keywords = cleanedText.toLowerCase().indexOf(\"key words\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// }\n\t\t\t// }\n\n\t\t\t// build Lucene query with 4-grams\n\t\t\tString queryString = getNGram(cleanedText, 4);\n\n\t\t\tQuery query = parser.parse(queryString);\n\t\t\tTopDocs results = searcher.search(query, 10);\n\t\t\tScoreDoc[] hits = results.scoreDocs;\n\t\t\t// System.out.println(hits.length + \" hits\");\n\n\t\t\tif (hits != null && hits.length > 1) {\n\n\t\t\t\tMap<Integer, String> queries = newHashMap();\n\t\t\t\tfor (ScoreDoc hit : hits) {\n\t\t\t\t\tDocument doc = searcher.doc(hit.doc);\n\t\t\t\t\tint pmid = new Integer(doc.get(PMID_FIELD));\n\t\t\t\t\tString text = doc.get(Txt2PubmedIdIndexer.CONTENT_FIELD);\n\n\t\t\t\t\tqueries.put(pmid, text);\n\t\t\t\t}\n\t\t\t\tMap<Integer, Float> scores = LuceneHelper.computeSimilarity2(\n\t\t\t\t\t\tqueries, cleanedText, 4);\n\n\t\t\t\t// for (Entry<Integer, Float> sc : scores.entrySet()) {\n\t\t\t\t// System.out.println(sc);\n\t\t\t\t// }\n\n\t\t\t\tInteger pmId = MapUtils.keyOfHighestValue(scores);\n\t\t\t\treturn new PmId(pmId, Confidence.HIGH);\n\n\t\t\t}\n\t\t\t// if (hits != null && hits.length > 1) {\n\t\t\t// Document doc = searcher.doc(hits[0].doc);\n\t\t\t// int pmidSYSTEM = new Integer(doc.get(PMID_FIELD));\n\t\t\t//\n\t\t\t// // String log = pdfF.getName() + \"\\t\";\n\t\t\t// // for (ScoreDoc scoreDoc : hits) {\n\t\t\t// // int pmid = new Integer(searcher.doc(scoreDoc.doc).get(\n\t\t\t// // PMID_FIELD));\n\t\t\t// // log += scoreDoc.score + \"\\t\" + pmid + \"\\t\";\n\t\t\t// // }\n\t\t\t// // log += pmidSYSTEM + \"\\t\";\n\t\t\t// // /System.out.println(log);\n\t\t\t//\n\t\t\t// float topResultScore = hits[0].score;\n\t\t\t// float secondResultScore = hits[1].score;\n\t\t\t// float score = topResultScore / secondResultScore;\n\t\t\t// // LOG.debug(\"{}: score {}\", pdfF.getName(), score);\n\t\t\t//\n\t\t\t// if (score > HIGH_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.HIGH);\n\t\t\t// } else if (score > LOW_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.LOW);\n\t\t\t// // return reprocess(hits, cleanedText, searcher);\n\t\t\t// }\n\t\t\t// }\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(\n\t\t\t\t\t\"could not extract PubmedId from \" + pdfF.getAbsolutePath(),\n\t\t\t\t\te);\n\t\t}\n\t\treturn null;\n\t}",
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"invocations": [
"createJCas",
"pipe",
"extractText",
"getDoc",
"getName",
"select",
"getPageId",
"getCoveredText",
"length",
"debug",
"getName",
"length",
"replaceAll",
"replaceAll",
"getNGram",
"parse",
"search",
"newHashMap",
"doc",
"get",
"get",
"put",
"computeSimilarity2",
"keyOfHighestValue",
"warn",
"getAbsolutePath"
],
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_31 | {
"fields": [],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BioAdiAbreviationAnnotatorTest.java",
"identifier": "BioAdiAbreviationAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n\tJCas jCas = getTestCas(//\n\t\t\"shunting for normal pressure hydrocephalus (NPH) was classified\");\n\t\n\tAnalysisEngine ae = createEngine(BioAdiAbreviationAnnotator.class);\n\tae.process(jCas);\n\n\tCollection<Abbreviation> a = select(jCas, Abbreviation.class);\n\tPrin.t(a);\n\tassertEquals(1, a.size());\n }",
"class_method_signature": "BioAdiAbreviationAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getTestCas",
"createEngine",
"process",
"select",
"t",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "dummy",
"modifier": "public",
"original_string": "public String dummy;",
"type": "String",
"var_name": "dummy"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/BioAdiAbreviationAnnotator.java",
"identifier": "BioAdiAbreviationAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "BioAdiAbreviationAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "BioAdiAbreviationAnnotator.process(JCas aJCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas aJCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas aJCas)",
"return": "void",
"signature": "void process(JCas aJCas)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\t\tif (text.length() > 0) {\n\n\t\t\tList<String> abrevs = Utility.performTest(\"\", text);\n\t\t\tfor (String abrevArr : abrevs) {\n\n\t\t\t\ttry {\n\t\t\t\t\t// e.g. NPH|normal pressure hydrocephalus|0.9929856278736344\n\t\t\t\t\tString[] abrev = abrevArr.split(\"\\\\|\");\n\n\t\t\t\t\tString shortF = abrev[0];\n\t\t\t\t\tString longF = abrev[1];\n\n\t\t\t\t\tint shortStart = text.indexOf(shortF);\n\t\t\t\t\tint longStart = text.indexOf(longF);\n\n\t\t\t\t\tAnnotation a = new Annotation(aJCas, longStart, longStart\n\t\t\t\t\t\t\t+ longF.length());\n\t\t\t\t\ta.setComponentId(BioAdiAbreviationAnnotator.class.getName());\n\t\t\t\t\ta.addToIndexes();\n\n\t\t\t\t\tAbbreviation abr = new Abbreviation(aJCas, shortStart,\n\t\t\t\t\t\t\tshortStart + shortF.length());\n\t\t\t\t\tabr.setDefinedHere(true); // TODO\n\t\t\t\t\tabr.setExpan(longF);\n\t\t\t\t\tabr.setTextReference(a);\n\t\t\t\t\tabr.setConfidence(abrev[2]);\n\t\t\t\t\tabr.setComponentId(BioAdiAbreviationAnnotator.class\n\t\t\t\t\t\t\t.getName());\n\t\t\t\t\tabr.addToIndexes();\n\n\t\t\t\t} catch (Exception e) { // something went wrong with the indexOf\n\t\t\t\t\tSystem.err.println(\"could not match abreviation, \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"class_method_signature": "BioAdiAbreviationAnnotator.process(JCas aJCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas aJCas)",
"identifier": "process",
"invocations": [
"getDocumentText",
"length",
"performTest",
"split",
"indexOf",
"indexOf",
"length",
"setComponentId",
"getName",
"addToIndexes",
"length",
"setDefinedHere",
"setExpan",
"setTextReference",
"setConfidence",
"setComponentId",
"getName",
"addToIndexes",
"println"
],
"modifiers": "@Override public",
"parameters": "(JCas aJCas)",
"return": "void",
"signature": "void process(JCas aJCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_27 | {
"fields": [],
"file": "modules/bluima_pdf/src/test/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemoverTest.java",
"identifier": "HyphenRemoverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDehyphenate2() {\n assertEquals(\"The basal nucleus of the hypocampus\\n\",\n dehyphenate(\"The basal nu-\\ncleus of the hypocampus\", \"a\"));\n }",
"class_method_signature": "HyphenRemoverTest.testDehyphenate2()",
"constructor": false,
"full_signature": "@Test public void testDehyphenate2()",
"identifier": "testDehyphenate2",
"invocations": [
"assertEquals",
"dehyphenate"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDehyphenate2()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HyphenRemover.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(HyphenRemover.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "patternHyphen = Pattern\n .compile(\"[\\\\u002D\\\\u00AD\\\\u2010]\\\\s*$\")",
"modifier": "public static final",
"original_string": "public static final Pattern patternHyphen = Pattern\n .compile(\"[\\\\u002D\\\\u00AD\\\\u2010]\\\\s*$\");",
"type": "Pattern",
"var_name": "patternHyphen"
},
{
"declarator": "WORD_SEPARATOR = \"\\\\W+\"",
"modifier": "private static final",
"original_string": "private static final String WORD_SEPARATOR = \"\\\\W+\";",
"type": "String",
"var_name": "WORD_SEPARATOR"
},
{
"declarator": "numberEnd = Pattern.compile(\"[0-9]-$\")",
"modifier": "private static final",
"original_string": "private static final Pattern numberEnd = Pattern.compile(\"[0-9]-$\");",
"type": "Pattern",
"var_name": "numberEnd"
},
{
"declarator": "numberStart = Pattern.compile(\"^[0-9]\")",
"modifier": "private static final",
"original_string": "private static final Pattern numberStart = Pattern.compile(\"^[0-9]\");",
"type": "Pattern",
"var_name": "numberStart"
},
{
"declarator": "greekEnd = Pattern.compile(\"\\\\p{InGreek}-$\")",
"modifier": "private static final",
"original_string": "private static final Pattern greekEnd = Pattern.compile(\"\\\\p{InGreek}-$\");",
"type": "Pattern",
"var_name": "greekEnd"
},
{
"declarator": "greekStart = Pattern.compile(\"^\\\\p{InGreek}+\")",
"modifier": "private static final",
"original_string": "private static final Pattern greekStart = Pattern.compile(\"^\\\\p{InGreek}+\");",
"type": "Pattern",
"var_name": "greekStart"
}
],
"file": "modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cleanup/HyphenRemover.java",
"identifier": "HyphenRemover",
"interfaces": "",
"methods": [
{
"class_method_signature": "HyphenRemover.shouldDehyphenate(String w1, String w2)",
"constructor": false,
"full_signature": "private static boolean shouldDehyphenate(String w1, String w2)",
"identifier": "shouldDehyphenate",
"modifiers": "private static",
"parameters": "(String w1, String w2)",
"return": "boolean",
"signature": "boolean shouldDehyphenate(String w1, String w2)",
"testcase": false
},
{
"class_method_signature": "HyphenRemover.dehyphenate(LineNumberReader reader, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(LineNumberReader reader, String docId)",
"identifier": "dehyphenate",
"modifiers": "public static",
"parameters": "(LineNumberReader reader, String docId)",
"return": "String",
"signature": "String dehyphenate(LineNumberReader reader, String docId)",
"testcase": false
},
{
"class_method_signature": "HyphenRemover.dehyphenate(String text, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(String text, String docId)",
"identifier": "dehyphenate",
"modifiers": "public static",
"parameters": "(String text, String docId)",
"return": "String",
"signature": "String dehyphenate(String text, String docId)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String dehyphenate(LineNumberReader reader, String docId) {\n\n String line;\n StringBuilder sb = new StringBuilder();\n\n try {\n while ((line = reader.readLine()) != null) {\n String lineOut = line;\n Matcher matcher = patternHyphen.matcher(line);\n\n // Allows to append consecutive lines with hyphens\n while (matcher.find() && ((line = reader.readLine()) != null)) {\n String behind[] = lineOut.split(WORD_SEPARATOR);\n String forward[] = line.trim().split(WORD_SEPARATOR);\n\n if (behind.length == 0) {\n lineOut = lineOut + \"\\n\" + line;\n continue;\n }\n\n String w1 = behind[(behind.length) - 1];\n String w2 = forward[0];\n if (shouldDehyphenate(w1, w2)) {\n // Remove hyphen from first line and concatenates second\n lineOut = lineOut.substring(0, lineOut.length() - 1)\n .trim() + line.trim();\n } else {\n // just concanates the two lines\n lineOut = lineOut + line;\n }\n matcher = patternHyphen.matcher(lineOut);\n }\n\n sb.append(lineOut.trim());\n sb.append(\"\\n\");\n }\n } catch (Throwable t) {\n //TODO happens sometimes, e.g. docId 1279669\n LOG.warn(\"failed to dehyphenate, docId \" + docId, print(t)); \n }\n return sb.toString();\n }",
"class_method_signature": "HyphenRemover.dehyphenate(LineNumberReader reader, String docId)",
"constructor": false,
"full_signature": "public static String dehyphenate(LineNumberReader reader, String docId)",
"identifier": "dehyphenate",
"invocations": [
"readLine",
"matcher",
"find",
"readLine",
"split",
"split",
"trim",
"shouldDehyphenate",
"trim",
"substring",
"length",
"trim",
"matcher",
"append",
"trim",
"append",
"warn",
"print",
"toString"
],
"modifiers": "public static",
"parameters": "(LineNumberReader reader, String docId)",
"return": "String",
"signature": "String dehyphenate(LineNumberReader reader, String docId)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_70 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCantFindNonexistantNode() {\n assertNull(trie.find(\"apple\"));\n }",
"class_method_signature": "RadixTreeImplTest.testCantFindNonexistantNode()",
"constructor": false,
"full_signature": "@Test public void testCantFindNonexistantNode()",
"identifier": "testCantFindNonexistantNode",
"invocations": [
"assertNull",
"find"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCantFindNonexistantNode()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public T find(String key) {\n Visitor<T,T> visitor = new VisitorImpl<T,T>() {\n\n public void visit(String key, RadixTreeNode<T> parent,\n RadixTreeNode<T> node) {\n if (node.isReal()) \n result = node.getValue();\n }\n };\n \n visit(key, visitor);\n \n return visitor.getResult();\n }",
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"invocations": [
"isReal",
"getValue",
"visit",
"getResult"
],
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_7 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(GeniaCorpusParserTest.class)",
"modifier": "",
"original_string": "Logger LOG = LoggerFactory.getLogger(GeniaCorpusParserTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/GeniaCorpusParserTest.java",
"identifier": "GeniaCorpusParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n\tInputStream is = this.getClass().getResourceAsStream(\n\t\t\"/GENIAcorpus3.02.xml/test_sample.xml\");\n\n\tSet parse = new GeniaCorpusParser().parse(is);\n\n\tassertEquals(1, parse.getArticle().size());\n\n\tArticle a = parse.getArticle().get(0);\n\tassertNotNull(a);\n }",
"class_method_signature": "GeniaCorpusParserTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getResourceAsStream",
"getClass",
"parse",
"assertEquals",
"size",
"getArticle",
"get",
"getArticle",
"assertNotNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(GeniaCorpusParser.class)",
"modifier": "",
"original_string": "Logger LOG = LoggerFactory.getLogger(GeniaCorpusParser.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "unmarshaller",
"modifier": "private",
"original_string": "private Unmarshaller unmarshaller;",
"type": "Unmarshaller",
"var_name": "unmarshaller"
},
{
"declarator": "jcSingelton = null",
"modifier": "private static",
"original_string": "private static JAXBContext jcSingelton = null;",
"type": "JAXBContext",
"var_name": "jcSingelton"
}
],
"file": "modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/GeniaCorpusParser.java",
"identifier": "GeniaCorpusParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "GeniaCorpusParser.getSingleton()",
"constructor": false,
"full_signature": "private JAXBContext getSingleton()",
"identifier": "getSingleton",
"modifiers": "private",
"parameters": "()",
"return": "JAXBContext",
"signature": "JAXBContext getSingleton()",
"testcase": false
},
{
"class_method_signature": "GeniaCorpusParser.GeniaCorpusParser()",
"constructor": true,
"full_signature": "public GeniaCorpusParser()",
"identifier": "GeniaCorpusParser",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GeniaCorpusParser()",
"testcase": false
},
{
"class_method_signature": "GeniaCorpusParser.parse(InputStream is)",
"constructor": false,
"full_signature": "public Set parse(InputStream is)",
"identifier": "parse",
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "Set",
"signature": "Set parse(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Set parse(InputStream is) throws FileNotFoundException,\n JAXBException {\n LOG.debug(\"parsing genia\");\n try {\n return (Set) unmarshaller.unmarshal(is);\n } finally {\n IOUtils.closeQuietly(is);\n }\n }",
"class_method_signature": "GeniaCorpusParser.parse(InputStream is)",
"constructor": false,
"full_signature": "public Set parse(InputStream is)",
"identifier": "parse",
"invocations": [
"debug",
"unmarshal",
"closeQuietly"
],
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "Set",
"signature": "Set parse(InputStream is)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_124 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/MapUtilsTest.java",
"identifier": "MapUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testKeyOfHighestValue() {\n\n Map<String, Double> mapp = new HashMap<String, Double>();\n mapp.put(\"s3.5\", 3.5);\n mapp.put(\"s1.5\", 1.5);\n mapp.put(\"s0.5\", 0.5);\n mapp.put(\"s0.6\", 0.6);\n mapp.put(\"2s3.5\", 3.5);\n mapp.put(\"s2.6\", 2.6);\n\n assertEquals(\"2s3.5\", MapUtils.keyOfHighestValue(mapp));\n }",
"class_method_signature": "MapUtilsTest.testKeyOfHighestValue()",
"constructor": false,
"full_signature": "@Test public void testKeyOfHighestValue()",
"identifier": "testKeyOfHighestValue",
"invocations": [
"put",
"put",
"put",
"put",
"put",
"put",
"assertEquals",
"keyOfHighestValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testKeyOfHighestValue()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/MapUtils.java",
"identifier": "MapUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapUtils.keyOfHighestValue(Map<K, V> map)",
"constructor": false,
"full_signature": "public static K keyOfHighestValue(Map<K, V> map)",
"identifier": "keyOfHighestValue",
"modifiers": "public static",
"parameters": "(Map<K, V> map)",
"return": "K",
"signature": "K keyOfHighestValue(Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN, final boolean reverse)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map, final boolean reverse)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, final boolean reverse)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <K, V extends Comparable<V>> K keyOfHighestValue(Map<K, V> map) {\n K bestKey = null;\n V bestValue = null;\n for (Entry<K, V> entry : map.entrySet()) {\n if (bestValue == null || entry.getValue().compareTo(bestValue) > 0) {\n bestKey = entry.getKey();\n bestValue = entry.getValue();\n }\n }\n return bestKey;\n }",
"class_method_signature": "MapUtils.keyOfHighestValue(Map<K, V> map)",
"constructor": false,
"full_signature": "public static K keyOfHighestValue(Map<K, V> map)",
"identifier": "keyOfHighestValue",
"invocations": [
"entrySet",
"compareTo",
"getValue",
"getKey",
"getValue"
],
"modifiers": "public static",
"parameters": "(Map<K, V> map)",
"return": "K",
"signature": "K keyOfHighestValue(Map<K, V> map)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_65 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/word2vec/Word2VecUtilsTest.java",
"identifier": "Word2VecUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void testBrainRegions() throws Exception {\n\n assertNotNull(Word2VecUtils.getClass(\"brain\"));\n\n String[] proteins = { \"acetylcholinesterase\", \"acrosin\",\n \"adenosylhomocysteinase\", \"adipogenin\", \"adiponectin\",\n \"adipophilin\", \"ADM\", \"ADM2\", \"adropin\", \"adseverin\",\n \"advillin\", \"afadin\", \"afamin\", \"aftiphilin\", \"agmatinase\",\n \"agrin\", \"aladin\", \"allantoinase\", \"alsin\", \"ameloblastin\",\n \"amelotin\", \"amidophosphoribosyltransferase\",\n \"aminomethyltransferase\", \"amphiphysin\", \"amphiregulin\",\n \"anamorsin\", \"angiogenin\", \"angiomotin\", \"ankycorbin\",\n \"antileukoproteinase\", \"apelin\", \"apolipoprotein(a)\",\n \"aprataxin\", \"artemin\", \"arylsulfatase\", \"aspartoacylase\",\n \"atherin\", \"attractin\", \"aureolysin\", \"axin\", \"azurocidin\",\n \"bacterioferritin\", \"barttin\", \"basigin\", \"battenin\", \"BET1\",\n \"biotinidase\", \"borealin\", \"brorin\", \"BUD13\", \"butyrophilin\",\n \"bystin\", \"cadherin\", \"calbindin\", \"calcitonin\", \"calcyphosin\",\n \"caldesmon\", \"calicin\", \"calmegin\", \"calmin\", \"calmodulin\",\n \"calnexin\", \"calpastatin\", \"calreticulin\", \"calretinin\",\n \"calsenilin\", \"calumenin\", \"capucin\", \"carabin\",\n \"carboxymethylenebutenolidase\", \"catalase\", \"caytaxin\",\n \"CD247\", \"centlein\", \"centriolin\", \"centrobin\", \"cerberus\",\n \"ceruloplasmin\", \"cholecystokinin\", \"cholinesterase\",\n \"chondroadherin\", \"chondrolectin\", \"chordin\", \"chymase\",\n \"cingulin\", \"cirhin\", \"claspin\", \"clusterin\", \"coagulase\",\n \"cochlin\", \"coilin\", \"colipase\", \"collectrin\", \"copine\",\n \"corneodesmosin\", \"cornifelin\", \"cornulin\", \"corticoliberin\",\n \"cortistatin\", \"cubilin\", \"cullin\", \"cystinosin\", \"cytoglobin\",\n \"delphilin\", \"dematin\", \"dendrin\", \"dermatopontin\",\n \"dermcidin\", \"dermokine\", \"desmin\", \"desmoplakin\", \"destrin\",\n \"DET1\", \"dihydroorotase\", \"dihydropyrimidinase\", \"dixin\",\n \"DPH3\", \"drebrin\", \"dymeclin\", \"dysbindin\", \"dysferlin\",\n \"dystroglycan\", \"dystrophin\", \"dystrotelin\", \"ecotin\",\n \"elafin\", \"elastin\", \"embigin\", \"emerin\", \"enamelin\",\n \"endoglin\", \"endoglucanase\", \"endomucin\", \"endosialin\",\n \"enolase\", \"ensconsin\", \"enteropeptidase\", \"envoplakin\",\n \"ephrin\", \"epigen\", \"epiphycan\", \"epiplakin\", \"eppin\", \"ermin\",\n \"erythropoietin\", \"ESF1\", \"espin\", \"exopolyphosphatase\",\n \"fascin\", \"ferrochelatase\", \"fibrocystin\", \"fibroleukin\",\n \"fibromodulin\", \"fibronectin\", \"fidgetin\", \"filaggrin\",\n \"filensin\", \"flagellin\", \"flavohemoprotein\", \"folliculin\",\n \"follistatin\", \"fractalkine\", \"fructokinase\", \"fukutin\",\n \"fumarylacetoacetase\", \"galactocerebrosidase\", \"galactokinase\",\n \"galanin\", \"gametogenetin\", \"gastricsin\", \"gastrin\",\n \"gelsolin\", \"geminin\", \"gephyrin\", \"geranyltranstransferase\",\n \"gigaxonin\", \"girdin\", \"gliomedin\", \"glomulin\", \"glucagon\",\n \"glucokinase\", \"glucosylceramidase\", \"glycodelin\",\n \"glycophorin\", \"goliath\", \"grancalcin\", \"granulins\",\n \"granulysin\", \"grifin\", \"guanylin\", \"hamartin\", \"haptoglobin\",\n \"harmonin\", \"hemogen\", \"hemojuvelin\", \"hemopexin\",\n \"heparanase\", \"hepcidin\", \"hephaestin\", \"hornerin\", \"humanin\",\n \"huntingtin\", \"hyccin\", \"ichthyin\", \"insulin\", \"inversin\",\n \"involucrin\", \"iporin\", \"isochorismatase\", \"IST1\", \"jouberin\",\n \"kalirin\", \"kanadaptin\", \"kaptin\", \"kazrin\", \"keratocan\",\n \"ketohexokinase\", \"kinectin\", \"kinocilin\", \"klotho\",\n \"kynureninase\", \"lactadherin\", \"lactoperoxidase\",\n \"lactotransferrin\", \"laforin\", \"latexin\", \"latherin\",\n \"layilin\", \"lebercilin\", \"legumain\", \"lengsin\", \"leptin\",\n \"leukosialin\", \"leupaxin\", \"ligatin\", \"limbin\", \"loricrin\",\n \"lumican\", \"macoilin\", \"malcavernin\", \"malectin\", \"maltoporin\",\n \"maspardin\", \"matrilysin\", \"meckelin\", \"melanophilin\",\n \"melanoregulin\", \"melanotransferrin\", \"membralin\", \"menin\",\n \"mesothelin\", \"meteorin\", \"microcephalin\", \"midasin\",\n \"midkine\", \"midnolin\", \"mimecan\", \"musculin\", \"muskelin\",\n \"myeloblastin\", \"myeloperoxidase\", \"myocardin\", \"myocilin\",\n \"myoferlin\", \"myogenin\", \"myoglobin\", \"myomegalin\",\n \"myoneurin\", \"myopalladin\", \"myotilin\", \"myotrophin\",\n \"myotubularin\", \"nardilysin\", \"nebulette\", \"nebulin\", \"necdin\",\n \"NEDD8\", \"neogenin\", \"nephrin\", \"nephronectin\", \"neprilysin\",\n \"nestin\", \"neudesin\", \"neugrin\", \"neuritin\", \"neurobeachin\",\n \"neurochondrin\", \"neurofibromin\", \"neuroglobin\", \"neurogranin\",\n \"neuroguidin\", \"neuromodulin\", \"neuronatin\", \"neuroplastin\",\n \"neurotrimin\", \"neurotrophin\", \"neurotrypsin\", \"neurturin\",\n \"nexilin\", \"nibrin\", \"nicalin\", \"nicastrin\", \"ninein\",\n \"nischarin\", \"nociceptin\", \"nocturnin\", \"noelin\", \"noggin\",\n \"norrin\", \"nostrin\", \"nucleolin\", \"nucleophosmin\",\n \"nucleoredoxin\", \"nurim\", \"nyctalopin\", \"obscurin\", \"occludin\",\n \"octanoyltransferase\", \"oculomedin\", \"oligoribonuclease\",\n \"opalin\", \"opticin\", \"optineurin\", \"orexin\", \"osteocrin\",\n \"osteomodulin\", \"osteopontin\", \"otoancorin\", \"otoferlin\",\n \"otogelin\", \"otoraplin\", \"otospiralin\", \"ovostatin\", \"paladin\",\n \"palladin\", \"pallidin\", \"palmdelphin\", \"pantetheinase\",\n \"papilin\", \"parafibromin\", \"paralemmin\", \"paraplegin\",\n \"parathymosin\", \"paxillin\", \"peflin\", \"pejvakin\", \"pendrin\",\n \"peregrin\", \"periaxin\", \"pericentrin\", \"perilipin\",\n \"periostin\", \"peripherin\", \"periplakin\", \"peroxidasin\",\n \"persephin\", \"pescadillo\", \"phakinin\", \"phosducin\",\n \"phosphoglucomutase\", \"phospholemman\", \"phosphomannomutase\",\n \"phosphopentomutase\", \"pikachurin\", \"pilin\", \"pinin\", \"pirin\",\n \"plasminogen\", \"plasmolipin\", \"pleckstrin\", \"pleiotrophin\",\n \"podocan\", \"podocin\", \"podoplanin\", \"porimin\", \"prestin\",\n \"probasin\", \"probetacellulin\", \"proepiregulin\", \"prohibitin\",\n \"prolactin\", \"prolargin\", \"promethin\", \"prominin\",\n \"promotilin\", \"properdin\", \"ProSAAS\", \"prostasin\",\n \"prothrombin\", \"prothyroliberin\", \"protogenin\",\n \"pyrazinamidase/nicotinamidase\", \"pyrin\", \"raftlin\",\n \"recoverin\", \"reelin\", \"regucalcin\", \"renin\", \"repetin\",\n \"resistin\", \"retbindin\", \"retinoschisin\", \"rhamnulokinase\",\n \"rhotekin\", \"ribokinase\", \"ribulokinase\", \"rootletin\",\n \"roquin\", \"rotatin\", \"sacsin\", \"saitohin\", \"sarcalumenin\",\n \"sarcolipin\", \"sarcospan\", \"sciellin\", \"sclerostin\",\n \"secretagogin\", \"secretin\", \"securin\", \"sedoheptulokinase\",\n \"seipin\", \"semaphorin\", \"separin\", \"seprase\", \"serglycin\",\n \"serotransferrin\", \"serpin\", \"sharpin\", \"sialin\",\n \"sialoadhesin\", \"smoothelin\", \"smoothened\", \"somatoliberin\",\n \"somatostatin\", \"somatotropin\", \"sorcin\", \"sororin\",\n \"sortilin\", \"SPARC\", \"spartin\", \"spastin\", \"spatacsin\",\n \"speriolin\", \"stannin\", \"staphylokinase\", \"statherin\",\n \"stathmin\", \"stereocilin\", \"striatin\", \"supervillin\",\n \"suprabasin\", \"symplekin\", \"synaptophysin\", \"synaptopodin\",\n \"synaptoporin\", \"syncoilin\", \"syncollin\", \"synemin\",\n \"syntabulin\", \"syntaphilin\", \"tafazzin\", \"tapasin\",\n \"telethonin\", \"tenascin\", \"tenomodulin\", \"tescalcin\", \"tesmin\",\n \"testin\", \"testisin\", \"tetranectin\", \"tetraspanin\",\n \"thioredoxin\", \"thrombopoietin\", \"thyroglobulin\", \"titin\",\n \"transaldolase\", \"transgelin\", \"transketolase\", \"translin\",\n \"transthyretin\", \"trehalase\", \"triadin\", \"trichohyalin\",\n \"tristetraprolin\", \"trophinin\", \"trypsin\", \"tryptase\",\n \"tryptophanase\", \"tsukushin\", \"tuberin\", \"tuftelin\",\n \"tyrosinase\", \"uricase\", \"urocortin\", \"uromodulin\", \"usherin\",\n \"uteroglobin\", \"utrophin\", \"vasculin\", \"vasorin\", \"vezatin\",\n \"vigilin\", \"vimentin\", \"vinculin\", \"vinexin\", \"vitrin\",\n \"vitronectin\", \"whirlin\", \"wolframin\", \"zonadhesin\", \"zyxin\" };\n String[] morphologies = { \"amacrine\", \"basket\", \"bitufted\", \"bouquet\",\n \"bipolar\", \"candelabrum\", \"chandelier\", \"cartwheel\", \"cone\",\n \"fusiform\", \"Golgi\", \"granule\", \"horizontal\", \"polymorphous\",\n \"Lugaro\", \"spiny\", \"mitral\", \"multipolar\", \"neurogliaform\",\n \"nest\", \"octopus\", \"Purkinje\", \"pyramidal\", \"Renshaw\", \"spiny\",\n \"star\", \"stellate\", \"tufted\", \"untufted\", \"unipolar\" };\n for (String test : proteins) {\n System.out.println(test);\n System.out.println(Word2VecUtils.getClass(test));\n }\n\n }",
"class_method_signature": "Word2VecUtilsTest.testBrainRegions()",
"constructor": false,
"full_signature": "@Test @Ignore public void testBrainRegions()",
"identifier": "testBrainRegions",
"invocations": [
"assertNotNull",
"getClass",
"println",
"println",
"getClass"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void testBrainRegions()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Word2VecUtils.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Word2VecUtils.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "MODEL_FILE = \"/Users/richarde/data_hdd/word2vec_models/vectors.bin\"",
"modifier": "static final",
"original_string": "static final String MODEL_FILE = \"/Users/richarde/data_hdd/word2vec_models/vectors.bin\";",
"type": "String",
"var_name": "MODEL_FILE"
},
{
"declarator": "w2v = new Word2Vec()",
"modifier": "private static",
"original_string": "private static Word2Vec w2v = new Word2Vec();",
"type": "Word2Vec",
"var_name": "w2v"
},
{
"declarator": "MODEL_FILE_CLASS = \"/Volumes/HDD2/ren_data/dev_hdd/bluebrain/9_lda/50_word2vec/word2vec_trunk/1m_ns.w2v.100classes.bin\"",
"modifier": "final static",
"original_string": "final static String MODEL_FILE_CLASS = \"/Volumes/HDD2/ren_data/dev_hdd/bluebrain/9_lda/50_word2vec/word2vec_trunk/1m_ns.w2v.100classes.bin\";",
"type": "String",
"var_name": "MODEL_FILE_CLASS"
},
{
"declarator": "w2c = null",
"modifier": "private static",
"original_string": "private static HashMap<String, Integer> w2c = null;",
"type": "HashMap<String, Integer>",
"var_name": "w2c"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/word2vec/Word2VecUtils.java",
"identifier": "Word2VecUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "Word2VecUtils.Word2VecUtils()",
"constructor": true,
"full_signature": "private Word2VecUtils()",
"identifier": "Word2VecUtils",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " Word2VecUtils()",
"testcase": false
},
{
"class_method_signature": "Word2VecUtils.getWordVector(String word)",
"constructor": false,
"full_signature": "public static float[] getWordVector(String word)",
"identifier": "getWordVector",
"modifiers": "public static",
"parameters": "(String word)",
"return": "float[]",
"signature": "float[] getWordVector(String word)",
"testcase": false
},
{
"class_method_signature": "Word2VecUtils.getClass(String word)",
"constructor": false,
"full_signature": "public static int getClass(String word)",
"identifier": "getClass",
"modifiers": "public static",
"parameters": "(String word)",
"return": "int",
"signature": "int getClass(String word)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int getClass(String word) {\n if (w2c == null) {\n try {\n w2c = Word2Vec.loadClassModel(MODEL_FILE_CLASS);\n } catch (IOException e) {\n System.err.println(\"could not load w2c\");\n }\n }\n if (w2c.containsKey(word.toLowerCase())) {\n\n return w2c.get(word.toLowerCase());\n } else {\n return -1;\n }\n }",
"class_method_signature": "Word2VecUtils.getClass(String word)",
"constructor": false,
"full_signature": "public static int getClass(String word)",
"identifier": "getClass",
"invocations": [
"loadClassModel",
"println",
"containsKey",
"toLowerCase",
"get",
"toLowerCase"
],
"modifiers": "public static",
"parameters": "(String word)",
"return": "int",
"signature": "int getClass(String word)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_32 | {
"fields": [],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BioLemmatizerNormalizerAnnotatorTest.java",
"identifier": "BioLemmatizerNormalizerAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n JCas jCas = UimaTests.getTokenizedTestCas(\"AMPAR is Regulated by GABA\");\n\n PipelineBuilder builder = new JcasPipelineBuilder(jCas);\n builder.add(BlueBioLemmatizer.class);\n builder.add(Tokens2KeepAnnotator.class);\n builder.add(BioLemmatizerNormalizerAnnotator.class);\n builder.process();\n\n Collection<Keep> keeps = select(jCas, Keep.class);\n assertEquals(5, keeps.size());\n Iterator<Keep> it = keeps.iterator();\n it.next();\n assertEquals(\"be\", it.next().getNormalizedText());\n assertEquals(\"regulate\", it.next().getNormalizedText());\n }",
"class_method_signature": "BioLemmatizerNormalizerAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getTokenizedTestCas",
"add",
"add",
"add",
"process",
"select",
"assertEquals",
"size",
"iterator",
"next",
"assertEquals",
"getNormalizedText",
"next",
"assertEquals",
"getNormalizedText",
"next"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "caseSensitive",
"modifier": "@ConfigurationParameter(name = PARAM_CASE_SENSITIVE, defaultValue = \"false\",//\n description = \"If true, tokens are not normalized to lowercase before string comparisions\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_CASE_SENSITIVE, defaultValue = \"false\",//\n description = \"If true, tokens are not normalized to lowercase before string comparisions\")\n private boolean caseSensitive;",
"type": "boolean",
"var_name": "caseSensitive"
},
{
"declarator": "onlyTokens",
"modifier": "@ConfigurationParameter(name = \"onlyTokens\", defaultValue = \"false\",//\n description = \"Only lemmatize the Keeps that are Tokens, rest are left unchanged.\")\n private",
"original_string": "@ConfigurationParameter(name = \"onlyTokens\", defaultValue = \"false\",//\n description = \"Only lemmatize the Keeps that are Tokens, rest are left unchanged.\")\n private boolean onlyTokens;",
"type": "boolean",
"var_name": "onlyTokens"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/BioLemmatizerNormalizerAnnotator.java",
"identifier": "BioLemmatizerNormalizerAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "BioLemmatizerNormalizerAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "BioLemmatizerNormalizerAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n for (Keep k : select(jCas, Keep.class)) {\n\n Annotation a = k.getEnclosedAnnot(); \n String normalized = null;\n \n // sometimes, Tokens already have a lemma form, use this one.\n if (a instanceof Token) {\n normalized = ((Token) a).getLemmaStr();\n if (!caseSensitive){\n \tnormalized = normalized.toLowerCase();\n }\n k.setNormalizedText(normalized);\n }\n else if(!onlyTokens) {\n\t // Biolemmatizer\n\t try {\n\t \tnormalized = BlueBioLemmatizer.lemmatize(a.getCoveredText(), \"\"); \n\t } catch (Exception e) {\n\t \tLOG.warn(\"Failed to lemmatize '{}'\", a.getCoveredText());\n\t normalized = a.getCoveredText().trim();\n\t }\n\t finally{\n\t if (!caseSensitive){\n\t \tnormalized = normalized.toLowerCase();\n\t }\n\t \n\t k.setNormalizedText(normalized);\n }\n } \n }\n }",
"class_method_signature": "BioLemmatizerNormalizerAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"select",
"getEnclosedAnnot",
"getLemmaStr",
"toLowerCase",
"setNormalizedText",
"lemmatize",
"getCoveredText",
"warn",
"getCoveredText",
"trim",
"getCoveredText",
"toLowerCase",
"setNormalizedText"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_24 | {
"fields": [],
"file": "modules/bluima_bbp/src/test/java/ch/epfl/bbp/uima/projects/brainregions/bams/FindSynonyms3Test.java",
"identifier": "FindSynonyms3Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n FindSynonyms3 fs3 = new FindSynonyms3();\n\n Set<String> s = fs3.getSynonyms(\"dentate gyrus\");\n System.out.println(join(s, \"; \"));\n assertEquals(5, s.size());\n // assertEquals(\"dentate gyrus\", s.get(0));\n\n s = fs3.getSynonyms(\"sublingual nucleus\");\n System.out.println(join(s, \"; \"));\n assertTrue(s.contains(\"nucleus of roller\"));\n \n s = fs3.getSynonyms(\"nucleus of Roller\");\n System.out.println(join(s, \"; \"));\n assertTrue(s.contains(\"sublingual nucleus\"));\n }",
"class_method_signature": "FindSynonyms3Test.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getSynonyms",
"println",
"join",
"assertEquals",
"size",
"getSynonyms",
"println",
"join",
"assertTrue",
"contains",
"getSynonyms",
"println",
"join",
"assertTrue",
"contains"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "lexiconName = { \"bams2004\", \"bams2013\", \"dong\", \"hof\",\n \"neuronames\", \"paxinos\", \"swanson\" }",
"modifier": "final",
"original_string": "final String[] lexiconName = { \"bams2004\", \"bams2013\", \"dong\", \"hof\",\n \"neuronames\", \"paxinos\", \"swanson\" };",
"type": "String[]",
"var_name": "lexiconName"
},
{
"declarator": "lexicon = newArrayList()",
"modifier": "",
"original_string": "List<Map<String, Concept>> lexicon = newArrayList();",
"type": "List<Map<String, Concept>>",
"var_name": "lexicon"
}
],
"file": "modules/bluima_bbp/src/main/java/ch/epfl/bbp/uima/projects/brainregions/bams/FindSynonyms3.java",
"identifier": "FindSynonyms3",
"interfaces": "",
"methods": [
{
"class_method_signature": "FindSynonyms3.FindSynonyms3()",
"constructor": true,
"full_signature": "public FindSynonyms3()",
"identifier": "FindSynonyms3",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FindSynonyms3()",
"testcase": false
},
{
"class_method_signature": "FindSynonyms3.getSynonyms(final String canonical)",
"constructor": false,
"full_signature": "public Set<String> getSynonyms(final String canonical)",
"identifier": "getSynonyms",
"modifiers": "public",
"parameters": "(final String canonical)",
"return": "Set<String>",
"signature": "Set<String> getSynonyms(final String canonical)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Set<String> getSynonyms(final String canonical) {\n Set<String> syn = Sets.newHashSet();\n\n for (Map<String, Concept> lexica : lexicon) {\n for (String lexCanonical : lexica.keySet()) {\n Set<String> variants = lexica.get(lexCanonical).getVariants();\n for (String variant : variants) {\n\n if (canonical.equals(variant)) {\n for (String v : variants) {\n syn.add(v.toLowerCase());\n }\n }\n }\n }\n }\n return syn;\n }",
"class_method_signature": "FindSynonyms3.getSynonyms(final String canonical)",
"constructor": false,
"full_signature": "public Set<String> getSynonyms(final String canonical)",
"identifier": "getSynonyms",
"invocations": [
"newHashSet",
"keySet",
"getVariants",
"get",
"equals",
"add",
"toLowerCase"
],
"modifiers": "public",
"parameters": "(final String canonical)",
"return": "Set<String>",
"signature": "Set<String> getSynonyms(final String canonical)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_73 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComplete() {\n // create a new Trie\n RadixTree<String> trie = new RadixTreeImpl<String>();\n \n trie.insert(\"apple\", \"apple\");\n trie.insert(\"appleshack\", \"appleshack\");\n trie.insert(\"applepie\", \"applepie\");\n trie.insert(\"applegold\", \"applegold\");\n trie.insert(\"applegood\", \"applegood\");\n \n assertEquals(\"\", trie.complete(\"z\"));\n assertEquals(\"apple\", trie.complete(\"a\"));\n assertEquals(\"apple\", trie.complete(\"app\"));\n assertEquals(\"appleshack\", trie.complete(\"apples\"));\n assertEquals(\"applego\", trie.complete(\"appleg\"));\n }",
"class_method_signature": "RadixTreeImplTest.testComplete()",
"constructor": false,
"full_signature": "@Test public void testComplete()",
"identifier": "testComplete",
"invocations": [
"insert",
"insert",
"insert",
"insert",
"insert",
"assertEquals",
"complete",
"assertEquals",
"complete",
"assertEquals",
"complete",
"assertEquals",
"complete",
"assertEquals",
"complete"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testComplete()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String complete(String prefix) {\n\t\treturn complete(prefix, root, \"\");\n\t}",
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"invocations": [
"complete"
],
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_49 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/io/DirectoryIteratorTest.java",
"identifier": "DirectoryIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testZip() throws Exception {\n\n File dir = Resources.getFile(\"directoryIterator/zipFileIterator.zip\");\n Iterator<File> it = DirectoryIterator.get(\n ZipDirectoryIterator.class.getSimpleName(), dir, null, false);\n ArrayList<File> list = newArrayList(it);\n assertEquals(3, list.size());\n assertEquals(\"test\", asText(list.get(0)).substring(0, 4));\n }",
"class_method_signature": "DirectoryIteratorTest.testZip()",
"constructor": false,
"full_signature": "@Test public void testZip()",
"identifier": "testZip",
"invocations": [
"getFile",
"get",
"getSimpleName",
"newArrayList",
"assertEquals",
"size",
"assertEquals",
"substring",
"asText",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testZip()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(DirectoryIterator.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(DirectoryIterator.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "LARGE = LargeDirectoryIterator.class\n .getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String LARGE = LargeDirectoryIterator.class\n .getSimpleName();",
"type": "String",
"var_name": "LARGE"
},
{
"declarator": "ZIP = ZipDirectoryIterator.class.getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String ZIP = ZipDirectoryIterator.class.getSimpleName();",
"type": "String",
"var_name": "ZIP"
},
{
"declarator": "dir",
"modifier": "protected",
"original_string": "protected File dir;",
"type": "File",
"var_name": "dir"
},
{
"declarator": "extensionFilter = null",
"modifier": "protected",
"original_string": "protected String extensionFilter = null;",
"type": "String",
"var_name": "extensionFilter"
},
{
"declarator": "isRecursive = false",
"modifier": "protected",
"original_string": "protected boolean isRecursive = false;",
"type": "boolean",
"var_name": "isRecursive"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/io/DirectoryIterator.java",
"identifier": "DirectoryIterator",
"interfaces": "",
"methods": [
{
"class_method_signature": "DirectoryIterator.DirectoryIterator()",
"constructor": true,
"full_signature": "public DirectoryIterator()",
"identifier": "DirectoryIterator",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DirectoryIterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setDirectory(File dir)",
"constructor": false,
"full_signature": "public DirectoryIterator setDirectory(File dir)",
"identifier": "setDirectory",
"modifiers": "public",
"parameters": "(File dir)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setDirectory(File dir)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setExtensionFilter(String ext)",
"constructor": false,
"full_signature": "public DirectoryIterator setExtensionFilter(String ext)",
"identifier": "setExtensionFilter",
"modifiers": "public",
"parameters": "(String ext)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setExtensionFilter(String ext)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setRecursive(boolean isRecursive)",
"constructor": false,
"full_signature": "public DirectoryIterator setRecursive(boolean isRecursive)",
"identifier": "setRecursive",
"modifiers": "public",
"parameters": "(boolean isRecursive)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setRecursive(boolean isRecursive)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.iterator()",
"constructor": false,
"full_signature": "public abstract Iterator<File> iterator()",
"identifier": "iterator",
"modifiers": "public abstract",
"parameters": "()",
"return": "Iterator<File>",
"signature": "Iterator<File> iterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive) throws IOException {\n\n try {\n // add package name to e.g. \"DefaultDirectoryIterator\"\n if (directoryIteratorType.indexOf('.') == -1) {\n directoryIteratorType = DirectoryIterator.class.getPackage()\n .getName() + \".\" + directoryIteratorType;\n }\n\n DirectoryIterator it = (DirectoryIterator) Class.forName(\n directoryIteratorType).newInstance();\n it.setDirectory(dir);\n it.setRecursive(recursive);\n\n if (extensionFilter != null)\n it.setExtensionFilter(extensionFilter);\n return it.iterator();\n } catch (Throwable t) {\n throw new IOException(t);\n }\n }",
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"invocations": [
"indexOf",
"getName",
"getPackage",
"newInstance",
"forName",
"setDirectory",
"setRecursive",
"setExtensionFilter",
"iterator"
],
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_108 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/MissingUtilsTest.java",
"identifier": "MissingUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFormat() {\n\n assertEquals(\"a1b2c\", MissingUtils.format(\"a{}b{}c\", 1, 2));\n assertEquals(\"1 b 2 c\", MissingUtils.format(\"{} b {} c\", 1, 2));\n\n assertEquals(\"ok not to have brackets\", \"\",\n MissingUtils.format(\"\", 1, 2));\n assertEquals(\"ok to have too many arguments\", \"a1b2c\",\n MissingUtils.format(\"a{}b{}c\", 1, 2, 3, 4));\n assertEquals(\"ok to have too few arguments\", \"a1b{{MISSING ARG}}c\",\n MissingUtils.format(\"a{}b{}c\", 1));\n }",
"class_method_signature": "MissingUtilsTest.testFormat()",
"constructor": false,
"full_signature": "@Test public void testFormat()",
"identifier": "testFormat",
"invocations": [
"assertEquals",
"format",
"assertEquals",
"format",
"assertEquals",
"format",
"assertEquals",
"format",
"assertEquals",
"format"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testFormat()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/MissingUtils.java",
"identifier": "MissingUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MissingUtils.sleep(long millis)",
"constructor": false,
"full_signature": "public static void sleep(long millis)",
"identifier": "sleep",
"modifiers": "public static",
"parameters": "(long millis)",
"return": "void",
"signature": "void sleep(long millis)",
"testcase": false
},
{
"class_method_signature": "MissingUtils.format(String msg, Object... args)",
"constructor": false,
"full_signature": "public static String format(String msg, Object... args)",
"identifier": "format",
"modifiers": "public static",
"parameters": "(String msg, Object... args)",
"return": "String",
"signature": "String format(String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "MissingUtils.printf(String msg, Object... args)",
"constructor": false,
"full_signature": "public static void printf(String msg, Object... args)",
"identifier": "printf",
"modifiers": "public static",
"parameters": "(String msg, Object... args)",
"return": "void",
"signature": "void printf(String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "MissingUtils.printTabbed(Object... args)",
"constructor": false,
"full_signature": "public static void printTabbed(Object... args)",
"identifier": "printTabbed",
"modifiers": "public static",
"parameters": "(Object... args)",
"return": "void",
"signature": "void printTabbed(Object... args)",
"testcase": false
},
{
"class_method_signature": "MissingUtils.getOrElse(Map<K, V> map, K key, V deflt)",
"constructor": false,
"full_signature": "public static V getOrElse(Map<K, V> map, K key, V deflt)",
"identifier": "getOrElse",
"modifiers": "public static",
"parameters": "(Map<K, V> map, K key, V deflt)",
"return": "V",
"signature": "V getOrElse(Map<K, V> map, K key, V deflt)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String format(String msg, Object... args) {\n\n if (args == null || args.length == 0)\n return msg;\n\n StringBuilder sb = new StringBuilder();\n int argId = 0;\n for (int i = 0; i < msg.length(); i++) {\n\n final char c = msg.charAt(i);\n if (c == '{' && msg.charAt(i + 1) == '}') {\n if (args.length > argId) {\n Object val = args[argId++];\n if (val == null)\n sb.append(\"null\");\n else\n sb.append(val.toString());\n } else {\n sb.append(\"{{MISSING ARG}}\");\n }\n i++;\n } else {\n sb.append(c);\n }\n }\n return sb.toString();\n }",
"class_method_signature": "MissingUtils.format(String msg, Object... args)",
"constructor": false,
"full_signature": "public static String format(String msg, Object... args)",
"identifier": "format",
"invocations": [
"length",
"charAt",
"charAt",
"append",
"append",
"toString",
"append",
"append",
"toString"
],
"modifiers": "public static",
"parameters": "(String msg, Object... args)",
"return": "String",
"signature": "String format(String msg, Object... args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_4 | {
"fields": [],
"file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/PubmedXmlParserTest.java",
"identifier": "PubmedXmlParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParsePubmedXmls() throws Exception {\n\n InputStream is = ResourceHelper\n .getInputStream(\"pubmed_abstracts/medline13n0787.xml\");\n List<MedlineCitation> arts = new PubmedXmlParser().parseAsArticles(is);\n assertEquals(3, arts.size());\n assertEquals(\n \"An unusual clinical manifestation in a factor IX deficient patient: orbital haemorrhage without trauma.\",\n arts.get(0).getArticle().getArticleTitle().getvalue());\n assertEquals(\"23419111\", arts.get(0).getPMID().getvalue());\n }",
"class_method_signature": "PubmedXmlParserTest.testParsePubmedXmls()",
"constructor": false,
"full_signature": "@Test public void testParsePubmedXmls()",
"identifier": "testParsePubmedXmls",
"invocations": [
"getInputStream",
"parseAsArticles",
"assertEquals",
"size",
"assertEquals",
"getvalue",
"getArticleTitle",
"getArticle",
"get",
"assertEquals",
"getvalue",
"getPMID",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParsePubmedXmls()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PubmedXmlParser.class)",
"modifier": "",
"original_string": "Logger LOG = LoggerFactory.getLogger(PubmedXmlParser.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "unmarshaller",
"modifier": "private",
"original_string": "private Unmarshaller unmarshaller;",
"type": "Unmarshaller",
"var_name": "unmarshaller"
},
{
"declarator": "jcSing = null",
"modifier": "private static",
"original_string": "private static JAXBContext jcSing = null;",
"type": "JAXBContext",
"var_name": "jcSing"
}
],
"file": "modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/PubmedXmlParser.java",
"identifier": "PubmedXmlParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "PubmedXmlParser.getSingleton()",
"constructor": false,
"full_signature": "private JAXBContext getSingleton()",
"identifier": "getSingleton",
"modifiers": "private",
"parameters": "()",
"return": "JAXBContext",
"signature": "JAXBContext getSingleton()",
"testcase": false
},
{
"class_method_signature": "PubmedXmlParser.PubmedXmlParser()",
"constructor": true,
"full_signature": "public PubmedXmlParser()",
"identifier": "PubmedXmlParser",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " PubmedXmlParser()",
"testcase": false
},
{
"class_method_signature": "PubmedXmlParser.parse(InputStream is)",
"constructor": false,
"full_signature": "public PubmedArticleSet parse(InputStream is)",
"identifier": "parse",
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "PubmedArticleSet",
"signature": "PubmedArticleSet parse(InputStream is)",
"testcase": false
},
{
"class_method_signature": "PubmedXmlParser.parseAsArticle(InputStream is)",
"constructor": false,
"full_signature": "public PubmedArticle parseAsArticle(InputStream is)",
"identifier": "parseAsArticle",
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "PubmedArticle",
"signature": "PubmedArticle parseAsArticle(InputStream is)",
"testcase": false
},
{
"class_method_signature": "PubmedXmlParser.parseAsArticles(InputStream is)",
"constructor": false,
"full_signature": "public List<MedlineCitation> parseAsArticles(InputStream is)",
"identifier": "parseAsArticles",
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "List<MedlineCitation>",
"signature": "List<MedlineCitation> parseAsArticles(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<MedlineCitation> parseAsArticles(InputStream is) {\n try {\n MedlineCitationSet parse = (MedlineCitationSet) unmarshaller\n .unmarshal(is);\n return parse.getMedlineCitation();\n } catch (Exception e) {\n LOG.warn(\"could not parse article \", e);\n return null;\n } finally {\n IOUtils.closeQuietly(is);\n }\n }",
"class_method_signature": "PubmedXmlParser.parseAsArticles(InputStream is)",
"constructor": false,
"full_signature": "public List<MedlineCitation> parseAsArticles(InputStream is)",
"identifier": "parseAsArticles",
"invocations": [
"unmarshal",
"getMedlineCitation",
"warn",
"closeQuietly"
],
"modifiers": "public",
"parameters": "(InputStream is)",
"return": "List<MedlineCitation>",
"signature": "List<MedlineCitation> parseAsArticles(InputStream is)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_86 | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"modifier": "",
"original_string": "String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"type": "String",
"var_name": "haystack"
}
],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelperTest.java",
"identifier": "LuceneHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void testSpeed() {\n\n long start = System.currentTimeMillis();\n float s = 0;\n for (int i = 0; i < 1000; i++) {\n s += LuceneHelper.subsumes(haystack, //\n \"This is a remarkably good book on graphical models\");\n }\n long time = System.currentTimeMillis() - start;\n LOG.debug(\"took {}ms (score {})\", time, s);\n }",
"class_method_signature": "LuceneHelperTest.testSpeed()",
"constructor": false,
"full_signature": "@Test @Ignore public void testSpeed()",
"identifier": "testSpeed",
"invocations": [
"currentTimeMillis",
"subsumes",
"currentTimeMillis",
"debug"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void testSpeed()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelper.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CONTENT_FIELD = \"text\"",
"modifier": "private static final",
"original_string": "private static final String CONTENT_FIELD = \"text\";",
"type": "String",
"var_name": "CONTENT_FIELD"
},
{
"declarator": "ID_FIELD = \"id\"",
"modifier": "private static final",
"original_string": "private static final String ID_FIELD = \"id\";",
"type": "String",
"var_name": "ID_FIELD"
},
{
"declarator": "anal = new StandardAnalyzer(Version.LUCENE_41)",
"modifier": "private static final",
"original_string": "private static final Analyzer anal = new StandardAnalyzer(Version.LUCENE_41);",
"type": "Analyzer",
"var_name": "anal"
},
{
"declarator": "parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal)",
"modifier": "private static final",
"original_string": "private static final QueryParser parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal);",
"type": "QueryParser",
"var_name": "parser"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelper.java",
"identifier": "LuceneHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static float subsumes(String haystack, final String needle) {\n\n if (needle == null || needle.length() < 0 || haystack == null\n || haystack.length() < 0)\n return 0f;\n\n try {\n // index the cleaned text\n RAMDirectory idx = new RAMDirectory();\n IndexWriterConfig iwc = new IndexWriterConfig(LUCENE_41, anal);\n IndexWriter writer = new IndexWriter(idx, iwc);\n\n // index\n Document doc = new Document();\n doc.add(new TextField(CONTENT_FIELD, haystack, Store.YES));\n writer.addDocument(doc);\n writer.close();\n\n // search\n IndexReader reader = open(idx);\n Query query = parser.parse(getNGram(needle, 3));\n TopDocs results = new IndexSearcher(reader).search(query, 1);\n float score = 0;\n for (ScoreDoc hit : results.scoreDocs) {\n score += hit.score;\n }\n reader.close();\n idx.close();\n return score;\n\n } catch (Exception e) {\n LOG.warn(\"could not computeSimilarity for \" + needle, e);\n }\n return 0f;\n }",
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"invocations": [
"length",
"length",
"add",
"addDocument",
"close",
"open",
"parse",
"getNGram",
"search",
"close",
"close",
"warn"
],
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_69 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCantFindRootNode() {\n assertNull(trie.find(\"\"));\n }",
"class_method_signature": "RadixTreeImplTest.testCantFindRootNode()",
"constructor": false,
"full_signature": "@Test public void testCantFindRootNode()",
"identifier": "testCantFindRootNode",
"invocations": [
"assertNull",
"find"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCantFindRootNode()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public T find(String key) {\n Visitor<T,T> visitor = new VisitorImpl<T,T>() {\n\n public void visit(String key, RadixTreeNode<T> parent,\n RadixTreeNode<T> node) {\n if (node.isReal()) \n result = node.getValue();\n }\n };\n \n visit(key, visitor);\n \n return visitor.getResult();\n }",
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"invocations": [
"isReal",
"getValue",
"visit",
"getResult"
],
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_28 | {
"fields": [],
"file": "modules/bluima_pdf/src/test/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patchTest.java",
"identifier": "diff_match_patchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimple() {\n assertEquals(0, diff_match_patch.match_main(\"hello\", \"hello\", 0));\n assertEquals(-1, diff_match_patch.match_main(\"hello\", \"world\", 0));\n assertEquals(\n -1,\n diff_match_patch\n .match_main(\n \"ReferencesLocker D: Measuring oral health: 18a conceptual framework.\\\\n\\\" + \\n\"\n + \" \\\"Community Dent Health 1988, 5:3-18.\",\n \"world center\", 0));\n }",
"class_method_signature": "diff_match_patchTest.testSimple()",
"constructor": false,
"full_signature": "@Test public void testSimple()",
"identifier": "testSimple",
"invocations": [
"assertEquals",
"match_main",
"assertEquals",
"match_main",
"assertEquals",
"match_main"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSimple()",
"testcase": true
} | {
"fields": [
{
"declarator": "Diff_Timeout = 1.0f",
"modifier": "private",
"original_string": "private float Diff_Timeout = 1.0f;",
"type": "float",
"var_name": "Diff_Timeout"
},
{
"declarator": "Diff_EditCost = 4",
"modifier": "private",
"original_string": "private short Diff_EditCost = 4;",
"type": "short",
"var_name": "Diff_EditCost"
},
{
"declarator": "Match_Threshold = 0.05f",
"modifier": "private static final",
"original_string": "private static final float Match_Threshold = 0.05f;",
"type": "float",
"var_name": "Match_Threshold"
},
{
"declarator": "Match_Distance = 1000",
"modifier": "private static final",
"original_string": "private static final int Match_Distance = 1000;",
"type": "int",
"var_name": "Match_Distance"
},
{
"declarator": "Patch_DeleteThreshold = 0.5f",
"modifier": "private static final",
"original_string": "private static final float Patch_DeleteThreshold = 0.5f;",
"type": "float",
"var_name": "Patch_DeleteThreshold"
},
{
"declarator": "Patch_Margin = 4",
"modifier": "private static final",
"original_string": "private static final short Patch_Margin = 4;",
"type": "short",
"var_name": "Patch_Margin"
},
{
"declarator": "Match_MaxBits = 32",
"modifier": "private static final",
"original_string": "private static final short Match_MaxBits = 32;",
"type": "short",
"var_name": "Match_MaxBits"
},
{
"declarator": "BLANKLINEEND = Pattern.compile(\"\\\\n\\\\r?\\\\n\\\\Z\",\n Pattern.DOTALL)",
"modifier": "private",
"original_string": "private Pattern BLANKLINEEND = Pattern.compile(\"\\\\n\\\\r?\\\\n\\\\Z\",\n Pattern.DOTALL);",
"type": "Pattern",
"var_name": "BLANKLINEEND"
},
{
"declarator": "BLANKLINESTART = Pattern.compile(\"\\\\A\\\\r?\\\\n\\\\r?\\\\n\",\n Pattern.DOTALL)",
"modifier": "private",
"original_string": "private Pattern BLANKLINESTART = Pattern.compile(\"\\\\A\\\\r?\\\\n\\\\r?\\\\n\",\n Pattern.DOTALL);",
"type": "Pattern",
"var_name": "BLANKLINESTART"
}
],
"file": "modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java",
"identifier": "diff_match_patch",
"interfaces": "",
"methods": [
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_main(String text1, String text2)",
"identifier": "diff_main",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2,\n boolean checklines)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines)",
"identifier": "diff_main",
"modifiers": "public",
"parameters": "(String text1, String text2,\n boolean checklines)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"identifier": "diff_main",
"modifiers": "private",
"parameters": "(String text1, String text2,\n boolean checklines, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"identifier": "diff_compute",
"modifiers": "private",
"parameters": "(String text1, String text2,\n boolean checklines, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_lineMode(String text1, String text2,\n long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_lineMode(String text1, String text2,\n long deadline)",
"identifier": "diff_lineMode",
"modifiers": "private",
"parameters": "(String text1, String text2,\n long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_lineMode(String text1, String text2,\n long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_bisect(String text1, String text2,\n long deadline)",
"constructor": false,
"full_signature": "protected LinkedList<Diff> diff_bisect(String text1, String text2,\n long deadline)",
"identifier": "diff_bisect",
"modifiers": "protected",
"parameters": "(String text1, String text2,\n long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_bisect(String text1, String text2,\n long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"identifier": "diff_bisectSplit",
"modifiers": "private",
"parameters": "(String text1, String text2,\n int x, int y, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_linesToChars(String text1, String text2)",
"constructor": false,
"full_signature": "protected LinesToCharsResult diff_linesToChars(String text1, String text2)",
"identifier": "diff_linesToChars",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "LinesToCharsResult",
"signature": "LinesToCharsResult diff_linesToChars(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"constructor": false,
"full_signature": "private String diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"identifier": "diff_linesToCharsMunge",
"modifiers": "private",
"parameters": "(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"return": "String",
"signature": "String diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"constructor": false,
"full_signature": "protected void diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"identifier": "diff_charsToLines",
"modifiers": "protected",
"parameters": "(LinkedList<Diff> diffs,\n List<String> lineArray)",
"return": "void",
"signature": "void diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonPrefix(String text1, String text2)",
"constructor": false,
"full_signature": "public int diff_commonPrefix(String text1, String text2)",
"identifier": "diff_commonPrefix",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonPrefix(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonSuffix(String text1, String text2)",
"constructor": false,
"full_signature": "public int diff_commonSuffix(String text1, String text2)",
"identifier": "diff_commonSuffix",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonSuffix(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonOverlap(String text1, String text2)",
"constructor": false,
"full_signature": "protected int diff_commonOverlap(String text1, String text2)",
"identifier": "diff_commonOverlap",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonOverlap(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_halfMatch(String text1, String text2)",
"constructor": false,
"full_signature": "protected String[] diff_halfMatch(String text1, String text2)",
"identifier": "diff_halfMatch",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "String[]",
"signature": "String[] diff_halfMatch(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_halfMatchI(String longtext, String shorttext, int i)",
"constructor": false,
"full_signature": "private String[] diff_halfMatchI(String longtext, String shorttext, int i)",
"identifier": "diff_halfMatchI",
"modifiers": "private",
"parameters": "(String longtext, String shorttext, int i)",
"return": "String[]",
"signature": "String[] diff_halfMatchI(String longtext, String shorttext, int i)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemantic(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupSemantic(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupSemantic",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupSemantic(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupSemanticLossless",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemanticScore(String one, String two)",
"constructor": false,
"full_signature": "private int diff_cleanupSemanticScore(String one, String two)",
"identifier": "diff_cleanupSemanticScore",
"modifiers": "private",
"parameters": "(String one, String two)",
"return": "int",
"signature": "int diff_cleanupSemanticScore(String one, String two)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupEfficiency",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupMerge(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupMerge(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupMerge",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupMerge(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_xIndex(LinkedList<Diff> diffs, int loc)",
"constructor": false,
"full_signature": "public int diff_xIndex(LinkedList<Diff> diffs, int loc)",
"identifier": "diff_xIndex",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs, int loc)",
"return": "int",
"signature": "int diff_xIndex(LinkedList<Diff> diffs, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_prettyHtml(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_prettyHtml(LinkedList<Diff> diffs)",
"identifier": "diff_prettyHtml",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_prettyHtml(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_text1(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_text1(LinkedList<Diff> diffs)",
"identifier": "diff_text1",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_text1(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_text2(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_text2(LinkedList<Diff> diffs)",
"identifier": "diff_text2",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_text2(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_levenshtein(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public int diff_levenshtein(LinkedList<Diff> diffs)",
"identifier": "diff_levenshtein",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "int",
"signature": "int diff_levenshtein(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_toDelta(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_toDelta(LinkedList<Diff> diffs)",
"identifier": "diff_toDelta",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_toDelta(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_fromDelta(String text1, String delta)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_fromDelta(String text1, String delta)",
"identifier": "diff_fromDelta",
"modifiers": "public",
"parameters": "(String text1, String delta)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_fromDelta(String text1, String delta)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_main(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "public static int match_main(String text, String pattern, int loc)",
"identifier": "match_main",
"modifiers": "public static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_main(String text, String pattern, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_bitap(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "protected static int match_bitap(String text, String pattern, int loc)",
"identifier": "match_bitap",
"modifiers": "protected static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_bitap(String text, String pattern, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_bitapScore(int e, int x, int loc, String pattern)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unused\") private static double match_bitapScore(int e, int x, int loc, String pattern)",
"identifier": "match_bitapScore",
"modifiers": "@SuppressWarnings(\"unused\") private static",
"parameters": "(int e, int x, int loc, String pattern)",
"return": "double",
"signature": "double match_bitapScore(int e, int x, int loc, String pattern)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_alphabet(String pattern)",
"constructor": false,
"full_signature": "protected static Map<Character, Integer> match_alphabet(String pattern)",
"identifier": "match_alphabet",
"modifiers": "protected static",
"parameters": "(String pattern)",
"return": "Map<Character, Integer>",
"signature": "Map<Character, Integer> match_alphabet(String pattern)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_addContext(Patch patch, String text)",
"constructor": false,
"full_signature": "protected void patch_addContext(Patch patch, String text)",
"identifier": "patch_addContext",
"modifiers": "protected",
"parameters": "(Patch patch, String text)",
"return": "void",
"signature": "void patch_addContext(Patch patch, String text)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, String text2)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, String text2)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, String text2,\n LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_deepCopy(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches)",
"identifier": "patch_deepCopy",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_apply(LinkedList<Patch> patches, String text)",
"constructor": false,
"full_signature": "public Object[] patch_apply(LinkedList<Patch> patches, String text)",
"identifier": "patch_apply",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches, String text)",
"return": "Object[]",
"signature": "Object[] patch_apply(LinkedList<Patch> patches, String text)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_addPadding(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public String patch_addPadding(LinkedList<Patch> patches)",
"identifier": "patch_addPadding",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "String",
"signature": "String patch_addPadding(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_splitMax(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public void patch_splitMax(LinkedList<Patch> patches)",
"identifier": "patch_splitMax",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "void",
"signature": "void patch_splitMax(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_toText(List<Patch> patches)",
"constructor": false,
"full_signature": "public String patch_toText(List<Patch> patches)",
"identifier": "patch_toText",
"modifiers": "public",
"parameters": "(List<Patch> patches)",
"return": "String",
"signature": "String patch_toText(List<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_fromText(String textline)",
"constructor": false,
"full_signature": "public List<Patch> patch_fromText(String textline)",
"identifier": "patch_fromText",
"modifiers": "public",
"parameters": "(String textline)",
"return": "List<Patch>",
"signature": "List<Patch> patch_fromText(String textline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.unescapeForEncodeUriCompatability(String str)",
"constructor": false,
"full_signature": "private static String unescapeForEncodeUriCompatability(String str)",
"identifier": "unescapeForEncodeUriCompatability",
"modifiers": "private static",
"parameters": "(String str)",
"return": "String",
"signature": "String unescapeForEncodeUriCompatability(String str)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int match_main(String text, String pattern, int loc) {\n // Check for null inputs.\n if (text == null || pattern == null) {\n throw new IllegalArgumentException(\"Null inputs. (match_main)\");\n }\n\n loc = Math.max(0, Math.min(loc, text.length()));\n if (text.equals(pattern)) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (text.length() == 0) {\n // Nothing to match.\n return -1;\n } else if (loc + pattern.length() <= text.length()\n && text.substring(loc, loc + pattern.length()).equals(pattern)) {\n // Perfect match at the perfect spot! (Includes case of null\n // pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return match_bitap(text, pattern, loc);\n }\n }",
"class_method_signature": "diff_match_patch.match_main(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "public static int match_main(String text, String pattern, int loc)",
"identifier": "match_main",
"invocations": [
"max",
"min",
"length",
"equals",
"length",
"length",
"length",
"equals",
"substring",
"length",
"match_bitap"
],
"modifiers": "public static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_main(String text, String pattern, int loc)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_90 | {
"fields": [],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedIdTest.java",
"identifier": "Txt2PubmedIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Deprecated\n public void testEvaluateFromLabPeople() throws IOException {\n\n String index = \"index_pubmed\";\n String base = \"/Users/richarde/Desktop/people/\";\n\n for (String user : new File(base).list()) {\n\n System.out.println(\"\\n\\n___________\\nproc user \" + user);\n\n Txt2PubmedId txt2PubmedId = new Txt2PubmedId(new File(index));\n int highMatch = 0, lowMatch = 0, noMatch = 0;\n @SuppressWarnings(\"unchecked\")\n Collection<File> listFiles = listFiles(new File(base + user + \"/\"),\n new String[] { \"pdf\" }, true);\n for (File pdfF : listFiles) {\n\n PmId pmId = txt2PubmedId.extract(pdfF);\n\n if (pmId == null) { // NO MATCH\n System.out.println(\"NO___match\\tNA\\t\"\n + pdfF.getAbsolutePath());\n noMatch++;\n\n } else if (pmId.getConfidence().equals(Confidence.HIGH)) {\n System.out.println(\"HIGH_match\\t\" + pmId.getPmId() + \"\\t\"\n + pdfF.getAbsolutePath());\n highMatch++;\n } else {\n System.out.println(\"LOW__match\\t\" + pmId.getPmId() + \"\\t\"\n + pdfF.getAbsolutePath());\n lowMatch++;\n }\n }\n\n System.out.println(\"highMatch=\" + highMatch);\n System.out.println(\"lowMatch=\" + lowMatch);\n System.out.println(\"noMatch=\" + noMatch);\n }\n }",
"class_method_signature": "Txt2PubmedIdTest.testEvaluateFromLabPeople()",
"constructor": false,
"full_signature": "@Test @Deprecated public void testEvaluateFromLabPeople()",
"identifier": "testEvaluateFromLabPeople",
"invocations": [
"list",
"println",
"listFiles",
"extract",
"println",
"getAbsolutePath",
"equals",
"getConfidence",
"println",
"getPmId",
"getAbsolutePath",
"println",
"getPmId",
"getAbsolutePath",
"println",
"println",
"println"
],
"modifiers": "@Test @Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void testEvaluateFromLabPeople()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Txt2PubmedId.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(Txt2PubmedId.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "HIGH_CONFIDENCE_THRESHOLD = 5f",
"modifier": "private static final",
"original_string": "private static final float HIGH_CONFIDENCE_THRESHOLD = 5f;",
"type": "float",
"var_name": "HIGH_CONFIDENCE_THRESHOLD"
},
{
"declarator": "LOW_CONFIDENCE_THRESHOLD = 1.6f",
"modifier": "private static final",
"original_string": "private static final float LOW_CONFIDENCE_THRESHOLD = 1.6f;",
"type": "float",
"var_name": "LOW_CONFIDENCE_THRESHOLD"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private QueryParser parser;",
"type": "QueryParser",
"var_name": "parser"
},
{
"declarator": "searcher",
"modifier": "private",
"original_string": "private IndexSearcher searcher;",
"type": "IndexSearcher",
"var_name": "searcher"
},
{
"declarator": "indexReader",
"modifier": "private",
"original_string": "private DirectoryReader indexReader;",
"type": "DirectoryReader",
"var_name": "indexReader"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedId.java",
"identifier": "Txt2PubmedId",
"interfaces": "",
"methods": [
{
"class_method_signature": "Txt2PubmedId.Txt2PubmedId(File indexPath)",
"constructor": true,
"full_signature": "public Txt2PubmedId(File indexPath)",
"identifier": "Txt2PubmedId",
"modifiers": "public",
"parameters": "(File indexPath)",
"return": "",
"signature": " Txt2PubmedId(File indexPath)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.getNGram(String text, int size)",
"constructor": false,
"full_signature": "public static String getNGram(String text, int size)",
"identifier": "getNGram",
"modifiers": "public static",
"parameters": "(String text, int size)",
"return": "String",
"signature": "String getNGram(String text, int size)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public PmId extract(File pdfF) {\n\t\ttry {\n\t\t\t// parse pdf\n\t\t\tJCas jCas = JCasFactory.createJCas();\n\t\t\tPDFTextStream pdf = new PDFTextStream(pdfF);\n\t\t\tBlockHandler blueHandler = new BlockHandler();\n\t\t\tpdf.pipe(blueHandler);\n\t\t\tPdfCollectionReader.extractText(jCas, blueHandler.getDoc(),\n\t\t\t\t\tpdfF.getName(), false);\n\n\t\t\t// crop: only first 2 pages of text\n\t\t\tString txt = \"\";\n\t\t\tfor (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t\tif (block.getPageId() < 2) {\n\t\t\t\t\ttxt += block.getCoveredText() + \" \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO\n\t\t\t// DocumentBlock largestBlock = null;\n\t\t\t// double maxFontSize=-2d;\n\t\t\t// for (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t// if (block.getFontSize() > maxFontSize) {\n\t\t\t// largestBlock=block;\n\t\t\t// }\n\t\t\t// }\n\t\t\t// String largestText = largestBlock.getCoveredText();\n\n\t\t\t// filter: must have minimum text length\n\t\t\tif (txt.length() < 100) {\n\t\t\t\tLOG.debug(\"{}: text too small for extraction (l={}\",\n\t\t\t\t\t\tpdfF.getName(), txt.length());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// cleanup: remove '\"' --> important for building Lucene query later\n\t\t\tString cleanedText = txt.replaceAll(\"[^A-Za-z0-9]\", \" \");\n\t\t\t// cleanup: remove all double spaces\n\t\t\tcleanedText = cleanedText.replaceAll(\" +\", \" \");\n\n\t\t\t// crop: if has \"abstract\", only keep subset\n\t\t\t// int abstractIndexOf =\n\t\t\t// cleanedText.toLowerCase().indexOf(\"abstract\");\n\t\t\t// if (abstractIndexOf > -1) {\n\t\t\t// // / System.out.println(\"abstract\");\n\t\t\t// cleanedText = cleanedText.substring(abstractIndexOf + 8,\n\t\t\t// min(abstractIndexOf + 1500, cleanedText.length()));\n\t\t\t// }\n\t\t\t// crop: if has \"keywords\", only keep subset\n\t\t\t// int keywords = cleanedText.toLowerCase().indexOf(\"keywords\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// } else {\n\t\t\t// keywords = cleanedText.toLowerCase().indexOf(\"key words\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// }\n\t\t\t// }\n\n\t\t\t// build Lucene query with 4-grams\n\t\t\tString queryString = getNGram(cleanedText, 4);\n\n\t\t\tQuery query = parser.parse(queryString);\n\t\t\tTopDocs results = searcher.search(query, 10);\n\t\t\tScoreDoc[] hits = results.scoreDocs;\n\t\t\t// System.out.println(hits.length + \" hits\");\n\n\t\t\tif (hits != null && hits.length > 1) {\n\n\t\t\t\tMap<Integer, String> queries = newHashMap();\n\t\t\t\tfor (ScoreDoc hit : hits) {\n\t\t\t\t\tDocument doc = searcher.doc(hit.doc);\n\t\t\t\t\tint pmid = new Integer(doc.get(PMID_FIELD));\n\t\t\t\t\tString text = doc.get(Txt2PubmedIdIndexer.CONTENT_FIELD);\n\n\t\t\t\t\tqueries.put(pmid, text);\n\t\t\t\t}\n\t\t\t\tMap<Integer, Float> scores = LuceneHelper.computeSimilarity2(\n\t\t\t\t\t\tqueries, cleanedText, 4);\n\n\t\t\t\t// for (Entry<Integer, Float> sc : scores.entrySet()) {\n\t\t\t\t// System.out.println(sc);\n\t\t\t\t// }\n\n\t\t\t\tInteger pmId = MapUtils.keyOfHighestValue(scores);\n\t\t\t\treturn new PmId(pmId, Confidence.HIGH);\n\n\t\t\t}\n\t\t\t// if (hits != null && hits.length > 1) {\n\t\t\t// Document doc = searcher.doc(hits[0].doc);\n\t\t\t// int pmidSYSTEM = new Integer(doc.get(PMID_FIELD));\n\t\t\t//\n\t\t\t// // String log = pdfF.getName() + \"\\t\";\n\t\t\t// // for (ScoreDoc scoreDoc : hits) {\n\t\t\t// // int pmid = new Integer(searcher.doc(scoreDoc.doc).get(\n\t\t\t// // PMID_FIELD));\n\t\t\t// // log += scoreDoc.score + \"\\t\" + pmid + \"\\t\";\n\t\t\t// // }\n\t\t\t// // log += pmidSYSTEM + \"\\t\";\n\t\t\t// // /System.out.println(log);\n\t\t\t//\n\t\t\t// float topResultScore = hits[0].score;\n\t\t\t// float secondResultScore = hits[1].score;\n\t\t\t// float score = topResultScore / secondResultScore;\n\t\t\t// // LOG.debug(\"{}: score {}\", pdfF.getName(), score);\n\t\t\t//\n\t\t\t// if (score > HIGH_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.HIGH);\n\t\t\t// } else if (score > LOW_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.LOW);\n\t\t\t// // return reprocess(hits, cleanedText, searcher);\n\t\t\t// }\n\t\t\t// }\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(\n\t\t\t\t\t\"could not extract PubmedId from \" + pdfF.getAbsolutePath(),\n\t\t\t\t\te);\n\t\t}\n\t\treturn null;\n\t}",
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"invocations": [
"createJCas",
"pipe",
"extractText",
"getDoc",
"getName",
"select",
"getPageId",
"getCoveredText",
"length",
"debug",
"getName",
"length",
"replaceAll",
"replaceAll",
"getNGram",
"parse",
"search",
"newHashMap",
"doc",
"get",
"get",
"put",
"computeSimilarity2",
"keyOfHighestValue",
"warn",
"getAbsolutePath"
],
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_53 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2Test.java",
"identifier": "WriteCoocurrencesToLoadfile2Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAEFilter() throws Exception {\n\n JCas jCas = FilterCoocurrencesByDistanceTest.doTest(5);\n assertTrue(\"one cooc, distance ok\", exists(jCas, Cooccurrence.class));\n Cooccurrence cooc = JCasUtil.selectSingle(jCas, Cooccurrence.class);\n cooc.setCooccurrenceType(\"bli bli\");\n\n String ouputFile = \"target/WriteCoocurrencesToLoadfile2Test_\"\n + currentTimeMillis() + \".txt\";\n AnalysisEngine wc = createEngine(\n WriteCoocurrencesToLoadfile2.class,//\n PARAM_OUTPUT_FILE,\n ouputFile,//\n PARAM_FIRST_ANNOT_TYPE,\n ProteinDictTerm.class.getSimpleName(),//\n PARAM_SECOND_ANNOT_TYPE, Measure.class.getSimpleName(),\n PARAM_COOCCURRENCE_TYPE, \"bli bli\", PARAM_VERBOSE, false);\n runPipeline(jCas, wc);\n wc.collectionProcessComplete();// manual call needed\n\n // verify file\n List<String> lines = LineReader.linesFrom(ouputFile);\n assertEquals(1, lines.size());\n assertEquals(\n \"-1\\t0.0\\tAMPA\\t9\\t13\\tProteinDictTerm\\tmM\\t0\\t5\\tMeasure\\t0\\t24\",\n lines.get(0));\n\n // does not pass filtering\n ouputFile = \"target/WriteCoocurrencesToLoadfile2Test_\"\n + currentTimeMillis() + \".txt\";\n wc = createEngine(\n WriteCoocurrencesToLoadfile2.class,//\n PARAM_OUTPUT_FILE,\n ouputFile,//\n PARAM_FIRST_ANNOT_TYPE,\n ProteinDictTerm.class.getSimpleName(),//\n PARAM_SECOND_ANNOT_TYPE, Measure.class.getSimpleName(),\n PARAM_COOCCURRENCE_TYPE, \"bla bla\");\n runPipeline(jCas, wc);\n wc.collectionProcessComplete();// manual call needed\n\n // verify file\n lines = LineReader.linesFrom(ouputFile);\n assertEquals(\"other files get filtered out\", 0,\n lines.size());\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2Test.testAEFilter()",
"constructor": false,
"full_signature": "@Test public void testAEFilter()",
"identifier": "testAEFilter",
"invocations": [
"doTest",
"assertTrue",
"exists",
"selectSingle",
"setCooccurrenceType",
"currentTimeMillis",
"createEngine",
"getSimpleName",
"getSimpleName",
"runPipeline",
"collectionProcessComplete",
"linesFrom",
"assertEquals",
"size",
"assertEquals",
"get",
"currentTimeMillis",
"createEngine",
"getSimpleName",
"getSimpleName",
"runPipeline",
"collectionProcessComplete",
"linesFrom",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAEFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "NULL = \"NULL\"",
"modifier": "private static final",
"original_string": "private static final String NULL = \"NULL\";",
"type": "String",
"var_name": "NULL"
},
{
"declarator": "outputFile",
"modifier": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected String outputFile;",
"type": "String",
"var_name": "outputFile"
},
{
"declarator": "annot1Type",
"modifier": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected String annot1Type;",
"type": "String",
"var_name": "annot1Type"
},
{
"declarator": "annot2Type",
"modifier": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected String annot2Type;",
"type": "String",
"var_name": "annot2Type"
},
{
"declarator": "cooccurrenceType",
"modifier": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected String cooccurrenceType;",
"type": "String",
"var_name": "cooccurrenceType"
},
{
"declarator": "writeSnippet",
"modifier": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected boolean writeSnippet;",
"type": "boolean",
"var_name": "writeSnippet"
},
{
"declarator": "writer",
"modifier": "protected",
"original_string": "protected LoadDataFileWriter writer;",
"type": "LoadDataFileWriter",
"var_name": "writer"
},
{
"declarator": "cooccCnt = 0",
"modifier": "protected",
"original_string": "protected int cooccCnt = 0;",
"type": "int",
"var_name": "cooccCnt"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2.java",
"identifier": "WriteCoocurrencesToLoadfile2",
"interfaces": "",
"methods": [
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.process(JCas jCas)",
"constructor": false,
"full_signature": "public void process(JCas jCas)",
"identifier": "process",
"modifiers": "public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"identifier": "snippet",
"modifiers": "public static",
"parameters": "(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"return": "String",
"signature": "String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void collectionProcessComplete()\n throws AnalysisEngineProcessException {\n super.collectionProcessComplete();\n try {\n writer.close();\n } catch (IOException e) {\n throw new AnalysisEngineProcessException(e);\n }\n LOG.debug(\"TOTAL cooccurrences\\t{}\\t[{}]\", cooccCnt, cooccurrenceType);\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"invocations": [
"collectionProcessComplete",
"close",
"debug"
],
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_112 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/io/LineReaderTest.java",
"identifier": "LineReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadIntsQuoted() throws Exception {\n\n int[] theints = LineReader.intsFrom(LineReader.class\n .getResourceAsStream(\"LineReader_ints_quoted.txt\"));\n assertEquals(4, theints.length);\n assertEquals(1, theints[0]);\n assertEquals(2, theints[1]);\n assertEquals(3, theints[2]);\n assertEquals(1, theints[3]);\n }",
"class_method_signature": "LineReaderTest.testReadIntsQuoted()",
"constructor": false,
"full_signature": "@Test public void testReadIntsQuoted()",
"identifier": "testReadIntsQuoted",
"invocations": [
"intsFrom",
"getResourceAsStream",
"assertEquals",
"assertEquals",
"assertEquals",
"assertEquals",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testReadIntsQuoted()",
"testcase": true
} | {
"fields": [
{
"declarator": "reader",
"modifier": "private",
"original_string": "private BufferedReader reader;",
"type": "BufferedReader",
"var_name": "reader"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/io/LineReader.java",
"identifier": "LineReader",
"interfaces": "implements Iterable<String>, Closeable",
"methods": [
{
"class_method_signature": "LineReader.LineReader(InputStream stream)",
"constructor": true,
"full_signature": "public LineReader(InputStream stream)",
"identifier": "LineReader",
"modifiers": "public",
"parameters": "(InputStream stream)",
"return": "",
"signature": " LineReader(InputStream stream)",
"testcase": false
},
{
"class_method_signature": "LineReader.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "LineReader.getText(String separator)",
"constructor": false,
"full_signature": "public String getText(String separator)",
"identifier": "getText",
"modifiers": "public",
"parameters": "(String separator)",
"return": "String",
"signature": "String getText(String separator)",
"testcase": false
},
{
"class_method_signature": "LineReader.asText(File f)",
"constructor": false,
"full_signature": "public static String asText(File f)",
"identifier": "asText",
"modifiers": "public static",
"parameters": "(File f)",
"return": "String",
"signature": "String asText(File f)",
"testcase": false
},
{
"class_method_signature": "LineReader.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "LineReader.finalize()",
"constructor": false,
"full_signature": "@Override protected void finalize()",
"identifier": "finalize",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void finalize()",
"testcase": false
},
{
"class_method_signature": "LineReader.iterator()",
"constructor": false,
"full_signature": "@Override public Iterator<String> iterator()",
"identifier": "iterator",
"modifiers": "@Override public",
"parameters": "()",
"return": "Iterator<String>",
"signature": "Iterator<String> iterator()",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(String filePath)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(String filePath)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(String filePath)",
"return": "List<String>",
"signature": "List<String> linesFrom(String filePath)",
"testcase": false
},
{
"class_method_signature": "LineReader.linesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static List<String> linesFrom(InputStream is)",
"identifier": "linesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "List<String>",
"signature": "List<String> linesFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(String file)",
"constructor": false,
"full_signature": "public static int[] intsFrom(String file)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "int[]",
"signature": "int[] intsFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.intsFrom(InputStream is)",
"constructor": false,
"full_signature": "public static int[] intsFrom(InputStream is)",
"identifier": "intsFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "int[]",
"signature": "int[] intsFrom(InputStream is)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(String file)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(String file)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(String file)",
"return": "double[]",
"signature": "double[] doublesFrom(String file)",
"testcase": false
},
{
"class_method_signature": "LineReader.doublesFrom(InputStream is)",
"constructor": false,
"full_signature": "public static double[] doublesFrom(InputStream is)",
"identifier": "doublesFrom",
"modifiers": "public static",
"parameters": "(InputStream is)",
"return": "double[]",
"signature": "double[] doublesFrom(InputStream is)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int[] intsFrom(String file) throws FileNotFoundException {\n return intsFrom(new FileInputStream(file));\n }",
"class_method_signature": "LineReader.intsFrom(String file)",
"constructor": false,
"full_signature": "public static int[] intsFrom(String file)",
"identifier": "intsFrom",
"invocations": [
"intsFrom"
],
"modifiers": "public static",
"parameters": "(String file)",
"return": "int[]",
"signature": "int[] intsFrom(String file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_45 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/BlueCasUtilTest.java",
"identifier": "BlueCasUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsContained() throws Exception {\n JCas jCas = getTestCas();\n\n Protein p1 = new Protein(jCas, 7, 10);\n p1.addToIndexes();\n Protein p2 = new Protein(jCas, 6, 10);\n p2.addToIndexes();\n\n assertTrue(isContained(p1, p2));\n assertFalse(isContained(p2, p1));\n\n Protein p3 = new Protein(jCas, 7, 10);\n p3.addToIndexes();\n assertTrue(\"true if has same begin-end\", isContained(p1, p3));\n }",
"class_method_signature": "BlueCasUtilTest.testIsContained()",
"constructor": false,
"full_signature": "@Test public void testIsContained()",
"identifier": "testIsContained",
"invocations": [
"getTestCas",
"addToIndexes",
"addToIndexes",
"assertTrue",
"isContained",
"assertFalse",
"isContained",
"addToIndexes",
"assertTrue",
"isContained"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testIsContained()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(BlueCasUtil.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(BlueCasUtil.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/BlueCasUtil.java",
"identifier": "BlueCasUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "BlueCasUtil.selectStrict(JCas jcas,\n Class<T> clasz, Class<?> strictClass)",
"constructor": false,
"full_signature": "public static Collection<T> selectStrict(JCas jcas,\n Class<T> clasz, Class<?> strictClass)",
"identifier": "selectStrict",
"modifiers": "public static",
"parameters": "(JCas jcas,\n Class<T> clasz, Class<?> strictClass)",
"return": "Collection<T>",
"signature": "Collection<T> selectStrict(JCas jcas,\n Class<T> clasz, Class<?> strictClass)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.isEmptyText(JCas jCas)",
"constructor": false,
"full_signature": "public static boolean isEmptyText(JCas jCas)",
"identifier": "isEmptyText",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "boolean",
"signature": "boolean isEmptyText(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.findOverlapping(JCas jcas, Annotation annotIn)",
"constructor": false,
"full_signature": "public static List<Annotation> findOverlapping(JCas jcas, Annotation annotIn)",
"identifier": "findOverlapping",
"modifiers": "public static",
"parameters": "(JCas jcas, Annotation annotIn)",
"return": "List<Annotation>",
"signature": "List<Annotation> findOverlapping(JCas jcas, Annotation annotIn)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.filterStrict(Iterable<T> raw,\n Class<?> strictClass)",
"constructor": false,
"full_signature": "public static Collection<T> filterStrict(Iterable<T> raw,\n Class<?> strictClass)",
"identifier": "filterStrict",
"modifiers": "public static",
"parameters": "(Iterable<T> raw,\n Class<?> strictClass)",
"return": "Collection<T>",
"signature": "Collection<T> filterStrict(Iterable<T> raw,\n Class<?> strictClass)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.getHeaderIntDocId(JCas jCas)",
"constructor": false,
"full_signature": "public static int getHeaderIntDocId(JCas jCas)",
"identifier": "getHeaderIntDocId",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "int",
"signature": "int getHeaderIntDocId(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.getHeaderDocId(JCas jCas)",
"constructor": false,
"full_signature": "public static String getHeaderDocId(JCas jCas)",
"identifier": "getHeaderDocId",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "String",
"signature": "String getHeaderDocId(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.getHeaderSource(JCas jCas)",
"constructor": false,
"full_signature": "public static String getHeaderSource(JCas jCas)",
"identifier": "getHeaderSource",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "String",
"signature": "String getHeaderSource(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.fixNoSentences(JCas jCas)",
"constructor": false,
"full_signature": "public static void fixNoSentences(JCas jCas)",
"identifier": "fixNoSentences",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void fixNoSentences(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.fixNoText(JCas jCas)",
"constructor": false,
"full_signature": "public static void fixNoText(JCas jCas)",
"identifier": "fixNoText",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void fixNoText(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.getSinglePosTag(Token t)",
"constructor": false,
"full_signature": "public static String getSinglePosTag(Token t)",
"identifier": "getSinglePosTag",
"modifiers": "public static",
"parameters": "(Token t)",
"return": "String",
"signature": "String getSinglePosTag(Token t)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.iterator(final CollectionReader cr)",
"constructor": false,
"full_signature": "public static Iterator<JCas> iterator(final CollectionReader cr)",
"identifier": "iterator",
"modifiers": "public static",
"parameters": "(final CollectionReader cr)",
"return": "Iterator<JCas>",
"signature": "Iterator<JCas> iterator(final CollectionReader cr)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.asList(final CollectionReader cr)",
"constructor": false,
"full_signature": "public static ArrayList<JCas> asList(final CollectionReader cr)",
"identifier": "asList",
"modifiers": "public static",
"parameters": "(final CollectionReader cr)",
"return": "ArrayList<JCas>",
"signature": "ArrayList<JCas> asList(final CollectionReader cr)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.inspect(JCas jcas, int begin, int end)",
"constructor": false,
"full_signature": "public static String inspect(JCas jcas, int begin, int end)",
"identifier": "inspect",
"modifiers": "public static",
"parameters": "(JCas jcas, int begin, int end)",
"return": "String",
"signature": "String inspect(JCas jcas, int begin, int end)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.inspect(Annotation a)",
"constructor": false,
"full_signature": "public static String inspect(Annotation a)",
"identifier": "inspect",
"modifiers": "public static",
"parameters": "(Annotation a)",
"return": "String",
"signature": "String inspect(Annotation a)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.setDocId(JCas jCas, int docId)",
"constructor": false,
"full_signature": "public static JCas setDocId(JCas jCas, int docId)",
"identifier": "setDocId",
"modifiers": "public static",
"parameters": "(JCas jCas, int docId)",
"return": "JCas",
"signature": "JCas setDocId(JCas jCas, int docId)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.haveSameBeginEnd(Annotation a, Annotation b)",
"constructor": false,
"full_signature": "public static boolean haveSameBeginEnd(Annotation a, Annotation b)",
"identifier": "haveSameBeginEnd",
"modifiers": "public static",
"parameters": "(Annotation a, Annotation b)",
"return": "boolean",
"signature": "boolean haveSameBeginEnd(Annotation a, Annotation b)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.getTitle(JCas jCas)",
"constructor": false,
"full_signature": "public static String getTitle(JCas jCas)",
"identifier": "getTitle",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "String",
"signature": "String getTitle(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.selectCovered(CAS cas,\n AnnotationFS coveringAnnotation)",
"constructor": false,
"full_signature": "public static List<Annotation> selectCovered(CAS cas,\n AnnotationFS coveringAnnotation)",
"identifier": "selectCovered",
"modifiers": "public static",
"parameters": "(CAS cas,\n AnnotationFS coveringAnnotation)",
"return": "List<Annotation>",
"signature": "List<Annotation> selectCovered(CAS cas,\n AnnotationFS coveringAnnotation)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.keepDoc(JCas jCas)",
"constructor": false,
"full_signature": "public static boolean keepDoc(JCas jCas)",
"identifier": "keepDoc",
"modifiers": "public static",
"parameters": "(JCas jCas)",
"return": "boolean",
"signature": "boolean keepDoc(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.asList(Iterable<T> select)",
"constructor": false,
"full_signature": "public static List<T> asList(Iterable<T> select)",
"identifier": "asList",
"modifiers": "public static",
"parameters": "(Iterable<T> select)",
"return": "List<T>",
"signature": "List<T> asList(Iterable<T> select)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.isDocAnnot(AnnotationFS a)",
"constructor": false,
"full_signature": "public static boolean isDocAnnot(AnnotationFS a)",
"identifier": "isDocAnnot",
"modifiers": "public static",
"parameters": "(AnnotationFS a)",
"return": "boolean",
"signature": "boolean isDocAnnot(AnnotationFS a)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.distance(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static int distance(Annotation a1, Annotation a2)",
"identifier": "distance",
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "int",
"signature": "int distance(Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.maxEnd(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static int maxEnd(Annotation a1, Annotation a2)",
"identifier": "maxEnd",
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "int",
"signature": "int maxEnd(Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.minBegin(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static int minBegin(Annotation a1, Annotation a2)",
"identifier": "minBegin",
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "int",
"signature": "int minBegin(Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.isBefore(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static Position isBefore(Annotation a1, Annotation a2)",
"identifier": "isBefore",
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "Position",
"signature": "Position isBefore(Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.isContained(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static boolean isContained(Annotation a1, Annotation a2)",
"identifier": "isContained",
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "boolean",
"signature": "boolean isContained(Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "BlueCasUtil.toList(StringArray tokens)",
"constructor": false,
"full_signature": "public static List<String> toList(StringArray tokens)",
"identifier": "toList",
"modifiers": "public static",
"parameters": "(StringArray tokens)",
"return": "List<String>",
"signature": "List<String> toList(StringArray tokens)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static boolean isContained(Annotation a1, Annotation a2) {\n return a1.getBegin() >= a2.getBegin() && a1.getEnd() <= a2.getEnd();\n }",
"class_method_signature": "BlueCasUtil.isContained(Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static boolean isContained(Annotation a1, Annotation a2)",
"identifier": "isContained",
"invocations": [
"getBegin",
"getBegin",
"getEnd",
"getEnd"
],
"modifiers": "public static",
"parameters": "(Annotation a1, Annotation a2)",
"return": "boolean",
"signature": "boolean isContained(Annotation a1, Annotation a2)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_104 | {
"fields": [],
"file": "utils/mallet_utils/src/test/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformersTest.java",
"identifier": "CommonNerTokenTransformersTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMorphologyUpperLowerNumberTransformer() {\n\t\tTokenTransformer transformer = CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer();\n\t\t\n\t\tassertEquals(\"\", transformer.transform(\"\"));\n\t\tassertEquals(\"aaaa\", transformer.transform(\"miau\"));\n\t\tassertEquals(\"AaAA\", transformer.transform(\"GnRH\"));\n\t\tassertEquals(\"a1\", transformer.transform(\"s2\"));\n\t\tassertEquals(\"aa11aaaa\", transformer.transform(\"rp47phox\"));\n\t\tassertEquals(\"A111\", transformer.transform(\"U937\"));\n\t\tassertEquals(\"A11a1\", transformer.transform(\"U23k9\"));\n\t\tassertEquals(\".\", transformer.transform(\".\"));\n\t}",
"class_method_signature": "CommonNerTokenTransformersTest.testMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "@Test public void testMorphologyUpperLowerNumberTransformer()",
"identifier": "testMorphologyUpperLowerNumberTransformer",
"invocations": [
"getMorphologyUpperLowerNumberTransformer",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMorphologyUpperLowerNumberTransformer()",
"testcase": true
} | {
"fields": [
{
"declarator": "ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "ToLowerCaseTransformer"
},
{
"declarator": "morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumber"
},
{
"declarator": "morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumberNonContiguous"
},
{
"declarator": "morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyContiguousNumbersGroupedOrRejected"
},
{
"declarator": "englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "englishVowelsTransformer"
}
],
"file": "utils/mallet_utils/src/main/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformers.java",
"identifier": "CommonNerTokenTransformers",
"interfaces": "",
"methods": [
{
"class_method_signature": "CommonNerTokenTransformers.getLowerCaseTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getLowerCaseTransformer()",
"identifier": "getLowerCaseTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getLowerCaseTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"identifier": "getMorphologyUpperLowerNumberTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.removeEqualContiguous(String in)",
"constructor": false,
"full_signature": "private static final String removeEqualContiguous(String in)",
"identifier": "removeEqualContiguous",
"modifiers": "private static final",
"parameters": "(String in)",
"return": "String",
"signature": "String removeEqualContiguous(String in)",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "getMorphologyUpperLowerNumberNonContiguousTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getEnglishVowelsTransformer()",
"identifier": "getEnglishVowelsTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getEnglishVowelsTransformer()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer() {\n\t\treturn morphologyUpperLowerNumber;\n\t}",
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"identifier": "getMorphologyUpperLowerNumberTransformer",
"invocations": [],
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_8 | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ReferencesClassifierAnnotatorTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory\n .getLogger(ReferencesClassifierAnnotatorTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_references_classifier/src/test/java/ch/epfl/bbp/uima/references/ReferencesClassifierAnnotatorTest.java",
"identifier": "ReferencesClassifierAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n JcasPipelineBuilder builder = new JcasPipelineBuilder();\n builder.add(ReferencesClassifierAnnotator.class,//\n PARAM_MODEL, DEFAULT_MODEL_NAME);\n\n // test\n for (String goldLabel : new String[] { LABEL_INSIDE, LABEL_OUTSIDE }) {\n\n double tp = 0, total = 0, filesToCheck = 20;\n\n for (File f : new File(CORPUS, goldLabel).listFiles()) {\n\n if (filesToCheck-- >= 0 && f.getName().endsWith(\".txt\")) {\n\n @SuppressWarnings(\"resource\")\n String txt = new LineReader(new FileInputStream(f))\n .getText(\"\\n\");\n JCas testCas = getTestCas(txt);\n new DocumentBlock(testCas, 0, txt.length()).addToIndexes();\n\n builder.process(testCas);\n String system = selectSingle(testCas, DocumentBlock.class)\n .getLabel();\n\n if ((system == null && goldLabel.equals(LABEL_OUTSIDE))\n || (system != null\n && system.equals(SECTION_REFERENCES_ENTRY) && goldLabel\n .equals(LABEL_INSIDE))) {\n tp++;\n }\n total++;\n }\n }\n\n double ratio = tp / total;\n if (!(ratio > 0.85 && ratio <= 1)) {\n throw new Exception(\"tp ratio \" + ratio + \" too low: \" + tp\n + \" out of total \" + total);\n } else {\n LOG.debug(\"ratio: {}\", ratio);\n }\n }\n }",
"class_method_signature": "ReferencesClassifierAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"add",
"listFiles",
"endsWith",
"getName",
"getText",
"getTestCas",
"addToIndexes",
"length",
"process",
"getLabel",
"selectSingle",
"equals",
"equals",
"equals",
"debug"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(PrintStates.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(PrintStates.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "LABEL_INSIDE = \"I\"",
"modifier": "static final",
"original_string": "static final String LABEL_INSIDE = \"I\";",
"type": "String",
"var_name": "LABEL_INSIDE"
},
{
"declarator": "LABEL_OUTSIDE = \"O\"",
"modifier": "static final",
"original_string": "static final String LABEL_OUTSIDE = \"O\";",
"type": "String",
"var_name": "LABEL_OUTSIDE"
},
{
"declarator": "DEFAULT_MODEL_NAME = \"references.model\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_MODEL_NAME = \"references.model\";",
"type": "String",
"var_name": "DEFAULT_MODEL_NAME"
},
{
"declarator": "modelName",
"modifier": "@ConfigurationParameter(name = BlueUima.PARAM_MODEL, //\n defaultValue = DEFAULT_MODEL_NAME, //\n description = \"the name of the classifier file (not path, just name) \")\n private",
"original_string": "@ConfigurationParameter(name = BlueUima.PARAM_MODEL, //\n defaultValue = DEFAULT_MODEL_NAME, //\n description = \"the name of the classifier file (not path, just name) \")\n private String modelName;",
"type": "String",
"var_name": "modelName"
},
{
"declarator": "classifier",
"modifier": "private",
"original_string": "private Classifier classifier;",
"type": "Classifier",
"var_name": "classifier"
},
{
"declarator": "pipes",
"modifier": "private",
"original_string": "private Pipe pipes;",
"type": "Pipe",
"var_name": "pipes"
}
],
"file": "modules/bluima_references_classifier/src/main/java/ch/epfl/bbp/uima/references/ReferencesClassifierAnnotator.java",
"identifier": "ReferencesClassifierAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ReferencesClassifierAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "ReferencesClassifierAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "public void process(JCas jCas)",
"identifier": "process",
"modifiers": "public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "ReferencesClassifierAnnotator.classify(String txt)",
"constructor": false,
"full_signature": "public String classify(String txt)",
"identifier": "classify",
"modifiers": "public",
"parameters": "(String txt)",
"return": "String",
"signature": "String classify(String txt)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n try {\n for (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n String label = classify(block.getCoveredText());\n if (label.equals(LABEL_INSIDE)) {\n block.setLabel(SECTION_REFERENCES_ENTRY);\n }\n }\n } catch (Exception e) {\n int pmId = BlueCasUtil.getHeaderIntDocId(jCas);\n LOG.warn(\"could not perform inference on \" + pmId, e);\n }\n }",
"class_method_signature": "ReferencesClassifierAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"select",
"classify",
"getCoveredText",
"equals",
"setLabel",
"getHeaderIntDocId",
"warn"
],
"modifiers": "public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_12 | {
"fields": [
{
"declarator": "LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\"",
"modifier": "public static final",
"original_string": "public static final String LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\";",
"type": "String",
"var_name": "LAUNCHER_ROOT"
},
{
"declarator": "TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH",
"modifier": "public static final",
"original_string": "public static final String TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH;",
"type": "String",
"var_name": "TESTS_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/LauncherTest.java",
"identifier": "LauncherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ParseException.class)\n public void testArgsFail() throws Exception {\n\n // \"because of: ERROR parsing 'args.pipeline' cannot compile and \"\n // + \"run '__java' parameter with value '1asfdafsd0\",\n Launcher.runPipeline(new File(TESTS_ROOT + \"laucher/args.pipeline\"),\n newArrayList(\"two words\", \"2\", \"1asfdafsd0\"));\n }",
"class_method_signature": "LauncherTest.testArgsFail()",
"constructor": false,
"full_signature": "@Test(expected = ParseException.class) public void testArgsFail()",
"identifier": "testArgsFail",
"invocations": [
"runPipeline",
"newArrayList"
],
"modifiers": "@Test(expected = ParseException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testArgsFail()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Launcher.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Launcher.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "OK_MESSAGE = \"Pipeline completed successfully :-)\"",
"modifier": "public static final",
"original_string": "public static final String OK_MESSAGE = \"Pipeline completed successfully :-)\";",
"type": "String",
"var_name": "OK_MESSAGE"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java",
"identifier": "Launcher",
"interfaces": "",
"methods": [
{
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
},
{
"class_method_signature": "Launcher.listPipelinesAndAsk(File pipelines)",
"constructor": false,
"full_signature": "public static void listPipelinesAndAsk(File pipelines)",
"identifier": "listPipelinesAndAsk",
"modifiers": "public static",
"parameters": "(File pipelines)",
"return": "void",
"signature": "void listPipelinesAndAsk(File pipelines)",
"testcase": false
},
{
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void runPipeline(File scriptFile, List<String> cliArgs)\n throws IOException, UIMAException, ParseException {\n if (!scriptFile.exists()) {\n throw new IOException(\"Script file does not exist (\"\n + scriptFile.getAbsolutePath() + \")\");\n }\n\n LOG.info(\"Parsing pipeline script at '{}'\",\n scriptFile.getAbsolutePath() + \" \\n with CLI parameters: \"\n + join(cliArgs, \", \"));\n Pipeline pipeline = null;\n try {\n pipeline = PipelineScriptParser.parse(scriptFile, cliArgs);\n } catch (ParseException e) {\n throw new ParseException(\"\\nERROR parsing '\" + scriptFile.getName()\n + \"'\\n\" + e.getMessage()\n + \"\\n(see the README.txt for the pipeline script format)\",\n e.getErrorOffset());\n }\n\n LOG.info(\"Successfully parsed pipeline script, now starting pipeline...\");\n LOG.info(\"*************************************************************\");\n pipeline.run();\n // will be printed if no exception.\n // used in pipeline tests, do not change\n System.out.println(OK_MESSAGE);\n }",
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"invocations": [
"exists",
"getAbsolutePath",
"info",
"getAbsolutePath",
"join",
"parse",
"getName",
"getMessage",
"getErrorOffset",
"info",
"info",
"run",
"println"
],
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_13 | {
"fields": [
{
"declarator": "LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\"",
"modifier": "public static final",
"original_string": "public static final String LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\";",
"type": "String",
"var_name": "LAUNCHER_ROOT"
},
{
"declarator": "TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH",
"modifier": "public static final",
"original_string": "public static final String TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH;",
"type": "String",
"var_name": "TESTS_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/LauncherTest.java",
"identifier": "LauncherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IOException.class)\n public void testArgsFail2() throws Exception {\n // no file\n Launcher.runPipeline(new File(\"blablalba\"), new ArrayList<String>());\n }",
"class_method_signature": "LauncherTest.testArgsFail2()",
"constructor": false,
"full_signature": "@Test(expected = IOException.class) public void testArgsFail2()",
"identifier": "testArgsFail2",
"invocations": [
"runPipeline"
],
"modifiers": "@Test(expected = IOException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testArgsFail2()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Launcher.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Launcher.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "OK_MESSAGE = \"Pipeline completed successfully :-)\"",
"modifier": "public static final",
"original_string": "public static final String OK_MESSAGE = \"Pipeline completed successfully :-)\";",
"type": "String",
"var_name": "OK_MESSAGE"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java",
"identifier": "Launcher",
"interfaces": "",
"methods": [
{
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
},
{
"class_method_signature": "Launcher.listPipelinesAndAsk(File pipelines)",
"constructor": false,
"full_signature": "public static void listPipelinesAndAsk(File pipelines)",
"identifier": "listPipelinesAndAsk",
"modifiers": "public static",
"parameters": "(File pipelines)",
"return": "void",
"signature": "void listPipelinesAndAsk(File pipelines)",
"testcase": false
},
{
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void runPipeline(File scriptFile, List<String> cliArgs)\n throws IOException, UIMAException, ParseException {\n if (!scriptFile.exists()) {\n throw new IOException(\"Script file does not exist (\"\n + scriptFile.getAbsolutePath() + \")\");\n }\n\n LOG.info(\"Parsing pipeline script at '{}'\",\n scriptFile.getAbsolutePath() + \" \\n with CLI parameters: \"\n + join(cliArgs, \", \"));\n Pipeline pipeline = null;\n try {\n pipeline = PipelineScriptParser.parse(scriptFile, cliArgs);\n } catch (ParseException e) {\n throw new ParseException(\"\\nERROR parsing '\" + scriptFile.getName()\n + \"'\\n\" + e.getMessage()\n + \"\\n(see the README.txt for the pipeline script format)\",\n e.getErrorOffset());\n }\n\n LOG.info(\"Successfully parsed pipeline script, now starting pipeline...\");\n LOG.info(\"*************************************************************\");\n pipeline.run();\n // will be printed if no exception.\n // used in pipeline tests, do not change\n System.out.println(OK_MESSAGE);\n }",
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"invocations": [
"exists",
"getAbsolutePath",
"info",
"getAbsolutePath",
"join",
"parse",
"getName",
"getMessage",
"getErrorOffset",
"info",
"info",
"run",
"println"
],
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_9 | {
"fields": [
{
"declarator": "LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\"",
"modifier": "public static final",
"original_string": "public static final String LAUNCHER_ROOT = BLUE_UIMA_ROOT\n + \"modules/bluima_scripting/\";",
"type": "String",
"var_name": "LAUNCHER_ROOT"
},
{
"declarator": "TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH",
"modifier": "public static final",
"original_string": "public static final String TESTS_ROOT = LAUNCHER_ROOT + TEST_RESOURCES_PATH;",
"type": "String",
"var_name": "TESTS_ROOT"
}
],
"file": "modules/bluima_scripting/src/test/java/ch/epfl/bbp/uima/laucher/LauncherTest.java",
"identifier": "LauncherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimple() throws Exception {\n Launcher.main(new String[] { TESTS_ROOT + \"laucher/simple.pipeline\" });\n }",
"class_method_signature": "LauncherTest.testSimple()",
"constructor": false,
"full_signature": "@Test public void testSimple()",
"identifier": "testSimple",
"invocations": [
"main"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSimple()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Launcher.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Launcher.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "OK_MESSAGE = \"Pipeline completed successfully :-)\"",
"modifier": "public static final",
"original_string": "public static final String OK_MESSAGE = \"Pipeline completed successfully :-)\";",
"type": "String",
"var_name": "OK_MESSAGE"
}
],
"file": "modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java",
"identifier": "Launcher",
"interfaces": "",
"methods": [
{
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
},
{
"class_method_signature": "Launcher.listPipelinesAndAsk(File pipelines)",
"constructor": false,
"full_signature": "public static void listPipelinesAndAsk(File pipelines)",
"identifier": "listPipelinesAndAsk",
"modifiers": "public static",
"parameters": "(File pipelines)",
"return": "void",
"signature": "void listPipelinesAndAsk(File pipelines)",
"testcase": false
},
{
"class_method_signature": "Launcher.runPipeline(File scriptFile, List<String> cliArgs)",
"constructor": false,
"full_signature": "public static void runPipeline(File scriptFile, List<String> cliArgs)",
"identifier": "runPipeline",
"modifiers": "public static",
"parameters": "(File scriptFile, List<String> cliArgs)",
"return": "void",
"signature": "void runPipeline(File scriptFile, List<String> cliArgs)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void main(String[] args) throws IOException, UIMAException,\n ParseException {\n\n // no pipeline --> list and ask\n if (args == null || args.length == 0) {\n String home = System.getProperty(\"basedir\");\n listPipelinesAndAsk(new File(home + \"/pipelines\"));\n }\n\n // pipeline provided --> run it\n else if (args.length > 0) {\n\n List<String> cliArgs = new ArrayList<String>();\n for (int i = 1; i < args.length; i++) {\n cliArgs.add(args[i]);\n }\n runPipeline(new File(args[0]), cliArgs);\n }\n\n else {\n System.err.println(\"Please provide a script file\");\n }\n }",
"class_method_signature": "Launcher.main(String[] args)",
"constructor": false,
"full_signature": "public static void main(String[] args)",
"identifier": "main",
"invocations": [
"getProperty",
"listPipelinesAndAsk",
"add",
"runPipeline",
"println"
],
"modifiers": "public static",
"parameters": "(String[] args)",
"return": "void",
"signature": "void main(String[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_44 | {
"fields": [],
"file": "modules/bluima_mongodb/src/test/java/ch/epfl/bbp/uima/mongo/MongoUtilsTest.java",
"identifier": "MongoUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testQueryFlag() throws Exception {\n String[] conn = MongoTest.getTestConn(\"MongoAddFlag\");\n\n MongoConnection mongo = new MongoConnection(conn);\n MongoUtils.addFlag(17, \"blih\", mongo);\n MongoUtils.addFlag(18, \"blih\", mongo);\n MongoUtils.addFlag(19, \"blih\", mongo);\n MongoUtils.addFlag(20, \"blih\", mongo);\n MongoUtils.addFlag(21, \"blih\", mongo);\n MongoUtils.addFlag(22, \"blih\", mongo);\n\n String query = \"{ftr.blih:1}\";\n List<JCas> l = asList(createReader(\n MongoCollectionReader.class, \n BlueUima.PARAM_DB_CONNECTION, conn, BlueUima.PARAM_QUERY, query));\n assertEquals(\"there should be 2 docs with flag 'blah'\", 6, l.size());\n\n MongoUtils.addFlag(118, \"asdfasdfblah\", mongo);\n MongoUtils.addFlag(119, \"blasfdasfdsfadh\", mongo);\n MongoUtils.addFlag(17, \"blah\", mongo);\n MongoUtils.addFlag(18, \"blah\", mongo);\n MongoUtils.addFlag(18, \"bluh\", mongo);\n MongoUtils.addFlag(19, \"bluh\", mongo);\n MongoUtils.addFlag(20, \"bluh\", mongo);\n\n query = \"{ $and: [ { ftr.blah: 1 }, { ftr.bluh: 1} ] }\";\n l = asList(createReader(MongoCollectionReader.class,\n BlueUima.PARAM_DB_CONNECTION, conn,\n BlueUima.PARAM_QUERY, query));\n assertEquals(\"there should be 1 docs\", 1, l.size());\n\n query = \"{ $and: [ { ftr.blah: { $ne: 1 } }, { ftr.bluh: 1} ] }\";\n l = asList(createReader(MongoCollectionReader.class,\n BlueUima.PARAM_DB_CONNECTION, conn,\n BlueUima.PARAM_QUERY, query));\n assertEquals(\"there should be 2 docs\", 2, l.size());\n\n }",
"class_method_signature": "MongoUtilsTest.testQueryFlag()",
"constructor": false,
"full_signature": "@Test public void testQueryFlag()",
"identifier": "testQueryFlag",
"invocations": [
"getTestConn",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"asList",
"createReader",
"assertEquals",
"size",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"addFlag",
"asList",
"createReader",
"assertEquals",
"size",
"asList",
"createReader",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testQueryFlag()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_mongodb/src/main/java/ch/epfl/bbp/uima/mongo/MongoUtils.java",
"identifier": "MongoUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MongoUtils.addFlag(int pmid, String flag, MongoConnection mongo)",
"constructor": false,
"full_signature": "public static void addFlag(int pmid, String flag, MongoConnection mongo)",
"identifier": "addFlag",
"modifiers": "public static",
"parameters": "(int pmid, String flag, MongoConnection mongo)",
"return": "void",
"signature": "void addFlag(int pmid, String flag, MongoConnection mongo)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void addFlag(int pmid, String flag, MongoConnection mongo) {\n BasicDBObject updateQuery = new BasicDBObject(ID, pmid + \"\");\n BasicDBObject fList = new BasicDBObject(MongoFieldMapping.FILTER,\n new BasicDBObject(flag, 1));\n mongo.coll.update(updateQuery, new BasicDBObject(\"$push\", fList), true,\n false);\n }",
"class_method_signature": "MongoUtils.addFlag(int pmid, String flag, MongoConnection mongo)",
"constructor": false,
"full_signature": "public static void addFlag(int pmid, String flag, MongoConnection mongo)",
"identifier": "addFlag",
"invocations": [
"update"
],
"modifiers": "public static",
"parameters": "(int pmid, String flag, MongoConnection mongo)",
"return": "void",
"signature": "void addFlag(int pmid, String flag, MongoConnection mongo)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_105 | {
"fields": [],
"file": "utils/mallet_utils/src/test/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformersTest.java",
"identifier": "CommonNerTokenTransformersTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMorphologyUpperLowerNumberNonContiguousTransformer() {\n\t\tTokenTransformer transformer = \n\t\t\t\tCommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer();\n\t\t\n\t\tassertEquals(\"\", transformer.transform(\"\"));\n\t\tassertEquals(\"a\", transformer.transform(\"miau\"));\n\t\tassertEquals(\"AaA\", transformer.transform(\"GnRH\"));\n\t\tassertEquals(\"a1\", transformer.transform(\"s2\"));\n\t\tassertEquals(\"a1a\", transformer.transform(\"rp47phox\"));\n\t\tassertEquals(\"A1\", transformer.transform(\"U937\"));\n\t\tassertEquals(\"A1a1\", transformer.transform(\"U23k9\"));\n\t\tassertEquals(\".\", transformer.transform(\".\"));\n\t}",
"class_method_signature": "CommonNerTokenTransformersTest.testMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "@Test public void testMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "testMorphologyUpperLowerNumberNonContiguousTransformer",
"invocations": [
"getMorphologyUpperLowerNumberNonContiguousTransformer",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform",
"assertEquals",
"transform"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": true
} | {
"fields": [
{
"declarator": "ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "ToLowerCaseTransformer"
},
{
"declarator": "morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumber = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"\\\\p{Lu}\", \"A\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{Ll}\", \"a\").\n\t\t\t\t\t\t replaceAll(\"\\\\p{N}\" , \"1\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumber"
},
{
"declarator": "morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyUpperLowerNumberNonContiguous = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn removeEqualContiguous(morphologyUpperLowerNumber.transform(token));\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyUpperLowerNumberNonContiguous"
},
{
"declarator": "morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer morphologyContiguousNumbersGroupedOrRejected = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\tif (!token.matches(\".*?\\\\p{N}.*?\"))\n\t\t\t\treturn null;\n\t\t\treturn token.replaceAll(\"\\\\p{N}+\", \"*\").toLowerCase();\t\t\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "morphologyContiguousNumbersGroupedOrRejected"
},
{
"declarator": "englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t}",
"modifier": "private static final",
"original_string": "private static final TokenTransformer englishVowelsTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.replaceAll(\"[^aeiouAEIOU]\", \"*\");\n\t\t}\n\t};",
"type": "TokenTransformer",
"var_name": "englishVowelsTransformer"
}
],
"file": "utils/mallet_utils/src/main/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformers.java",
"identifier": "CommonNerTokenTransformers",
"interfaces": "",
"methods": [
{
"class_method_signature": "CommonNerTokenTransformers.getLowerCaseTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getLowerCaseTransformer()",
"identifier": "getLowerCaseTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getLowerCaseTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"identifier": "getMorphologyUpperLowerNumberTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.removeEqualContiguous(String in)",
"constructor": false,
"full_signature": "private static final String removeEqualContiguous(String in)",
"identifier": "removeEqualContiguous",
"modifiers": "private static final",
"parameters": "(String in)",
"return": "String",
"signature": "String removeEqualContiguous(String in)",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "getMorphologyUpperLowerNumberNonContiguousTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"identifier": "getMorphologyContiguousNumbersGroupedOrRejectedTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyContiguousNumbersGroupedOrRejectedTransformer()",
"testcase": false
},
{
"class_method_signature": "CommonNerTokenTransformers.getEnglishVowelsTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getEnglishVowelsTransformer()",
"identifier": "getEnglishVowelsTransformer",
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getEnglishVowelsTransformer()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer() {\n\t\treturn morphologyUpperLowerNumberNonContiguous;\n\t}",
"class_method_signature": "CommonNerTokenTransformers.getMorphologyUpperLowerNumberNonContiguousTransformer()",
"constructor": false,
"full_signature": "public static TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"identifier": "getMorphologyUpperLowerNumberNonContiguousTransformer",
"invocations": [],
"modifiers": "public static",
"parameters": "()",
"return": "TokenTransformer",
"signature": "TokenTransformer getMorphologyUpperLowerNumberNonContiguousTransformer()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_52 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2Test.java",
"identifier": "WriteCoocurrencesToLoadfile2Test",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAE() throws Exception {\n\n JCas jCas = FilterCoocurrencesByDistanceTest.doTest(5);\n assertTrue(\"one cooc, distance ok\", exists(jCas, Cooccurrence.class));\n\n String ouputFile = \"target/WriteCoocurrencesToLoadfile2Test_\"\n + currentTimeMillis() + \".txt\";\n AnalysisEngine wc = createEngine(WriteCoocurrencesToLoadfile2.class,//\n PARAM_OUTPUT_FILE, ouputFile,//\n PARAM_FIRST_ANNOT_TYPE, ProteinDictTerm.class.getSimpleName(),//\n PARAM_SECOND_ANNOT_TYPE, Measure.class.getSimpleName());\n runPipeline(jCas, wc);\n wc.collectionProcessComplete();// manual call needed\n\n // verify file\n List<String> lines = LineReader.linesFrom(ouputFile);\n assertEquals(1, lines.size());\n assertEquals(\n \"-1\\t0.0\\tAMPA\\t9\\t13\\tProteinDictTerm\\tmM\\t0\\t5\\tMeasure\\t0\\t24\\t<strong class=\\\"Measure\\\">12 mM</strong> of <strong class=\\\"ProteinDictTerm\\\">AMPA</strong> was found.\",\n lines.get(0));\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2Test.testAE()",
"constructor": false,
"full_signature": "@Test public void testAE()",
"identifier": "testAE",
"invocations": [
"doTest",
"assertTrue",
"exists",
"currentTimeMillis",
"createEngine",
"getSimpleName",
"getSimpleName",
"runPipeline",
"collectionProcessComplete",
"linesFrom",
"assertEquals",
"size",
"assertEquals",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAE()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(WriteCoocurrencesToLoadfile2.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "NULL = \"NULL\"",
"modifier": "private static final",
"original_string": "private static final String NULL = \"NULL\";",
"type": "String",
"var_name": "NULL"
},
{
"declarator": "outputFile",
"modifier": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_OUTPUT_FILE, mandatory = true)\n protected String outputFile;",
"type": "String",
"var_name": "outputFile"
},
{
"declarator": "annot1Type",
"modifier": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_FIRST_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the first annotation.\")\n protected String annot1Type;",
"type": "String",
"var_name": "annot1Type"
},
{
"declarator": "annot2Type",
"modifier": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_SECOND_ANNOT_TYPE, mandatory = false, defaultValue = NULL, //\n description = \"an optional id (String, int, whatever) to identify the type of the second annotation.\")\n protected String annot2Type;",
"type": "String",
"var_name": "annot2Type"
},
{
"declarator": "cooccurrenceType",
"modifier": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_COOCCURRENCE_TYPE, mandatory = false, //\n description = \"Whether to filter on a given type of cooccurrence. If none provided, selects ALL cooccurrences.\")\n protected String cooccurrenceType;",
"type": "String",
"var_name": "cooccurrenceType"
},
{
"declarator": "writeSnippet",
"modifier": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected",
"original_string": "@ConfigurationParameter(name = PARAM_VERBOSE, defaultValue = \"true\", //\n mandatory = false, description = \"Whether to write the snippet text.\")\n protected boolean writeSnippet;",
"type": "boolean",
"var_name": "writeSnippet"
},
{
"declarator": "writer",
"modifier": "protected",
"original_string": "protected LoadDataFileWriter writer;",
"type": "LoadDataFileWriter",
"var_name": "writer"
},
{
"declarator": "cooccCnt = 0",
"modifier": "protected",
"original_string": "protected int cooccCnt = 0;",
"type": "int",
"var_name": "cooccCnt"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/ae/relations/WriteCoocurrencesToLoadfile2.java",
"identifier": "WriteCoocurrencesToLoadfile2",
"interfaces": "",
"methods": [
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.process(JCas jCas)",
"constructor": false,
"full_signature": "public void process(JCas jCas)",
"identifier": "process",
"modifiers": "public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"constructor": false,
"full_signature": "public static String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"identifier": "snippet",
"modifiers": "public static",
"parameters": "(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"return": "String",
"signature": "String snippet(JCas jCas, int snippetBegin, int snippetEnd,\n Annotation a1, Annotation a2)",
"testcase": false
},
{
"class_method_signature": "WriteCoocurrencesToLoadfile2.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void collectionProcessComplete()\n throws AnalysisEngineProcessException {\n super.collectionProcessComplete();\n try {\n writer.close();\n } catch (IOException e) {\n throw new AnalysisEngineProcessException(e);\n }\n LOG.debug(\"TOTAL cooccurrences\\t{}\\t[{}]\", cooccCnt, cooccurrenceType);\n }",
"class_method_signature": "WriteCoocurrencesToLoadfile2.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"invocations": [
"collectionProcessComplete",
"close",
"debug"
],
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_113 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/io/TsvUtilsTest.java",
"identifier": "TsvUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n\n Map<Integer, String> map = TsvUtils.loadIntString(\n TsvUtils.class.getResourceAsStream(\"TsvUtils_int_string.tsv\"),\n false);\n assertEquals(3, map.size());\n assertEquals(\"bb\", map.get(2));\n assertEquals(\"dd\", map.get(1));\n }",
"class_method_signature": "TsvUtilsTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"loadIntString",
"getResourceAsStream",
"assertEquals",
"size",
"assertEquals",
"get",
"assertEquals",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/io/TsvUtils.java",
"identifier": "TsvUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "TsvUtils.loadIntString(InputStream is,\n boolean hasHeader)",
"constructor": false,
"full_signature": "public static Map<Integer, String> loadIntString(InputStream is,\n boolean hasHeader)",
"identifier": "loadIntString",
"modifiers": "public static",
"parameters": "(InputStream is,\n boolean hasHeader)",
"return": "Map<Integer, String>",
"signature": "Map<Integer, String> loadIntString(InputStream is,\n boolean hasHeader)",
"testcase": false
},
{
"class_method_signature": "TsvUtils.loadStringInt(InputStream is,\n boolean hasHeader)",
"constructor": false,
"full_signature": "public static Map<String, Integer> loadStringInt(InputStream is,\n boolean hasHeader)",
"identifier": "loadStringInt",
"modifiers": "public static",
"parameters": "(InputStream is,\n boolean hasHeader)",
"return": "Map<String, Integer>",
"signature": "Map<String, Integer> loadStringInt(InputStream is,\n boolean hasHeader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<Integer, String> loadIntString(InputStream is,\n boolean hasHeader) throws IOException {\n Map<Integer, String> map = new HashMap<Integer, String>();\n for (List<String> line : new TSVReader(is, hasHeader)) {\n map.put(parseInt(line.get(0)), line.get(1));\n }\n return map;\n }",
"class_method_signature": "TsvUtils.loadIntString(InputStream is,\n boolean hasHeader)",
"constructor": false,
"full_signature": "public static Map<Integer, String> loadIntString(InputStream is,\n boolean hasHeader)",
"identifier": "loadIntString",
"invocations": [
"put",
"parseInt",
"get",
"get"
],
"modifiers": "public static",
"parameters": "(InputStream is,\n boolean hasHeader)",
"return": "Map<Integer, String>",
"signature": "Map<Integer, String> loadIntString(InputStream is,\n boolean hasHeader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_91 | {
"fields": [],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedIdTest.java",
"identifier": "Txt2PubmedIdTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExtractFromLabPeople() throws IOException {\n\n String index = Txt2PubmedIdIndexer.INDEX_PATH;\n String base = \"/Users/richarde/Desktop/people/\";\n String out = \"/Users/richarde/Desktop/people_extracted/\";\n\n for (String user : new File(base).list()) {\n System.out.println(\"\\n\\n___________\\nprocessing user \" + user);\n if (user.startsWith(\".\"))\n continue;\n\n\n Txt2PubmedId txt2PubmedId = new Txt2PubmedId(new File(index));\n\n @SuppressWarnings(\"unchecked\")\n Collection<File> listFiles = listFiles(new File(base + user + \"/\"),\n new String[] { \"pdf\" }, true);\n for (File pdfF : listFiles) {\n\n PmId pmId = txt2PubmedId.extract(pdfF);\n if (pmId != null) {\n System.out.println(\"extracted \" + pmId.getPmId());\n\n Files.copy(pdfF, new File(out + pmId.getPmId() + \".pdf\"));\n\n }\n }\n }\n }",
"class_method_signature": "Txt2PubmedIdTest.testExtractFromLabPeople()",
"constructor": false,
"full_signature": "@Test public void testExtractFromLabPeople()",
"identifier": "testExtractFromLabPeople",
"invocations": [
"list",
"println",
"startsWith",
"listFiles",
"extract",
"println",
"getPmId",
"copy",
"getPmId"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testExtractFromLabPeople()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Txt2PubmedId.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory.getLogger(Txt2PubmedId.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "HIGH_CONFIDENCE_THRESHOLD = 5f",
"modifier": "private static final",
"original_string": "private static final float HIGH_CONFIDENCE_THRESHOLD = 5f;",
"type": "float",
"var_name": "HIGH_CONFIDENCE_THRESHOLD"
},
{
"declarator": "LOW_CONFIDENCE_THRESHOLD = 1.6f",
"modifier": "private static final",
"original_string": "private static final float LOW_CONFIDENCE_THRESHOLD = 1.6f;",
"type": "float",
"var_name": "LOW_CONFIDENCE_THRESHOLD"
},
{
"declarator": "parser",
"modifier": "private",
"original_string": "private QueryParser parser;",
"type": "QueryParser",
"var_name": "parser"
},
{
"declarator": "searcher",
"modifier": "private",
"original_string": "private IndexSearcher searcher;",
"type": "IndexSearcher",
"var_name": "searcher"
},
{
"declarator": "indexReader",
"modifier": "private",
"original_string": "private DirectoryReader indexReader;",
"type": "DirectoryReader",
"var_name": "indexReader"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/Txt2PubmedId.java",
"identifier": "Txt2PubmedId",
"interfaces": "",
"methods": [
{
"class_method_signature": "Txt2PubmedId.Txt2PubmedId(File indexPath)",
"constructor": true,
"full_signature": "public Txt2PubmedId(File indexPath)",
"identifier": "Txt2PubmedId",
"modifiers": "public",
"parameters": "(File indexPath)",
"return": "",
"signature": " Txt2PubmedId(File indexPath)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.getNGram(String text, int size)",
"constructor": false,
"full_signature": "public static String getNGram(String text, int size)",
"identifier": "getNGram",
"modifiers": "public static",
"parameters": "(String text, int size)",
"return": "String",
"signature": "String getNGram(String text, int size)",
"testcase": false
},
{
"class_method_signature": "Txt2PubmedId.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public PmId extract(File pdfF) {\n\t\ttry {\n\t\t\t// parse pdf\n\t\t\tJCas jCas = JCasFactory.createJCas();\n\t\t\tPDFTextStream pdf = new PDFTextStream(pdfF);\n\t\t\tBlockHandler blueHandler = new BlockHandler();\n\t\t\tpdf.pipe(blueHandler);\n\t\t\tPdfCollectionReader.extractText(jCas, blueHandler.getDoc(),\n\t\t\t\t\tpdfF.getName(), false);\n\n\t\t\t// crop: only first 2 pages of text\n\t\t\tString txt = \"\";\n\t\t\tfor (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t\tif (block.getPageId() < 2) {\n\t\t\t\t\ttxt += block.getCoveredText() + \" \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO\n\t\t\t// DocumentBlock largestBlock = null;\n\t\t\t// double maxFontSize=-2d;\n\t\t\t// for (DocumentBlock block : select(jCas, DocumentBlock.class)) {\n\t\t\t// if (block.getFontSize() > maxFontSize) {\n\t\t\t// largestBlock=block;\n\t\t\t// }\n\t\t\t// }\n\t\t\t// String largestText = largestBlock.getCoveredText();\n\n\t\t\t// filter: must have minimum text length\n\t\t\tif (txt.length() < 100) {\n\t\t\t\tLOG.debug(\"{}: text too small for extraction (l={}\",\n\t\t\t\t\t\tpdfF.getName(), txt.length());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// cleanup: remove '\"' --> important for building Lucene query later\n\t\t\tString cleanedText = txt.replaceAll(\"[^A-Za-z0-9]\", \" \");\n\t\t\t// cleanup: remove all double spaces\n\t\t\tcleanedText = cleanedText.replaceAll(\" +\", \" \");\n\n\t\t\t// crop: if has \"abstract\", only keep subset\n\t\t\t// int abstractIndexOf =\n\t\t\t// cleanedText.toLowerCase().indexOf(\"abstract\");\n\t\t\t// if (abstractIndexOf > -1) {\n\t\t\t// // / System.out.println(\"abstract\");\n\t\t\t// cleanedText = cleanedText.substring(abstractIndexOf + 8,\n\t\t\t// min(abstractIndexOf + 1500, cleanedText.length()));\n\t\t\t// }\n\t\t\t// crop: if has \"keywords\", only keep subset\n\t\t\t// int keywords = cleanedText.toLowerCase().indexOf(\"keywords\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// } else {\n\t\t\t// keywords = cleanedText.toLowerCase().indexOf(\"key words\");\n\t\t\t// if (keywords > -1) {\n\t\t\t// // / System.out.println(\"keywords\");\n\t\t\t// cleanedText = cleanedText.substring(0, keywords);\n\t\t\t// }\n\t\t\t// }\n\n\t\t\t// build Lucene query with 4-grams\n\t\t\tString queryString = getNGram(cleanedText, 4);\n\n\t\t\tQuery query = parser.parse(queryString);\n\t\t\tTopDocs results = searcher.search(query, 10);\n\t\t\tScoreDoc[] hits = results.scoreDocs;\n\t\t\t// System.out.println(hits.length + \" hits\");\n\n\t\t\tif (hits != null && hits.length > 1) {\n\n\t\t\t\tMap<Integer, String> queries = newHashMap();\n\t\t\t\tfor (ScoreDoc hit : hits) {\n\t\t\t\t\tDocument doc = searcher.doc(hit.doc);\n\t\t\t\t\tint pmid = new Integer(doc.get(PMID_FIELD));\n\t\t\t\t\tString text = doc.get(Txt2PubmedIdIndexer.CONTENT_FIELD);\n\n\t\t\t\t\tqueries.put(pmid, text);\n\t\t\t\t}\n\t\t\t\tMap<Integer, Float> scores = LuceneHelper.computeSimilarity2(\n\t\t\t\t\t\tqueries, cleanedText, 4);\n\n\t\t\t\t// for (Entry<Integer, Float> sc : scores.entrySet()) {\n\t\t\t\t// System.out.println(sc);\n\t\t\t\t// }\n\n\t\t\t\tInteger pmId = MapUtils.keyOfHighestValue(scores);\n\t\t\t\treturn new PmId(pmId, Confidence.HIGH);\n\n\t\t\t}\n\t\t\t// if (hits != null && hits.length > 1) {\n\t\t\t// Document doc = searcher.doc(hits[0].doc);\n\t\t\t// int pmidSYSTEM = new Integer(doc.get(PMID_FIELD));\n\t\t\t//\n\t\t\t// // String log = pdfF.getName() + \"\\t\";\n\t\t\t// // for (ScoreDoc scoreDoc : hits) {\n\t\t\t// // int pmid = new Integer(searcher.doc(scoreDoc.doc).get(\n\t\t\t// // PMID_FIELD));\n\t\t\t// // log += scoreDoc.score + \"\\t\" + pmid + \"\\t\";\n\t\t\t// // }\n\t\t\t// // log += pmidSYSTEM + \"\\t\";\n\t\t\t// // /System.out.println(log);\n\t\t\t//\n\t\t\t// float topResultScore = hits[0].score;\n\t\t\t// float secondResultScore = hits[1].score;\n\t\t\t// float score = topResultScore / secondResultScore;\n\t\t\t// // LOG.debug(\"{}: score {}\", pdfF.getName(), score);\n\t\t\t//\n\t\t\t// if (score > HIGH_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.HIGH);\n\t\t\t// } else if (score > LOW_CONFIDENCE_THRESHOLD) {\n\t\t\t// return new PmId(new Integer(pmidSYSTEM), Confidence.LOW);\n\t\t\t// // return reprocess(hits, cleanedText, searcher);\n\t\t\t// }\n\t\t\t// }\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(\n\t\t\t\t\t\"could not extract PubmedId from \" + pdfF.getAbsolutePath(),\n\t\t\t\t\te);\n\t\t}\n\t\treturn null;\n\t}",
"class_method_signature": "Txt2PubmedId.extract(File pdfF)",
"constructor": false,
"full_signature": "public PmId extract(File pdfF)",
"identifier": "extract",
"invocations": [
"createJCas",
"pipe",
"extractText",
"getDoc",
"getName",
"select",
"getPageId",
"getCoveredText",
"length",
"debug",
"getName",
"length",
"replaceAll",
"replaceAll",
"getNGram",
"parse",
"search",
"newHashMap",
"doc",
"get",
"get",
"put",
"computeSimilarity2",
"keyOfHighestValue",
"warn",
"getAbsolutePath"
],
"modifiers": "public",
"parameters": "(File pdfF)",
"return": "PmId",
"signature": "PmId extract(File pdfF)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_29 | {
"fields": [],
"file": "modules/bluima_pdf/src/test/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patchTest.java",
"identifier": "diff_match_patchTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n // TODO fails diff_match_patchTest.testRefs:24 Pattern too long for this\n // application.\n public void testRefs() {\n assertEquals(\n 10,\n diff_match_patch\n .match_main(\n //\n \"ReferencesLocker D: Measuring oral health: 18a conceptual framework.\\\\n\\\" + \\n\"\n + \" \\\"Community Dent Health 1988, 5:3-18.\",\n \"Locker D: Measuring oral health: a conceptual framework.\\n\"\n + \"Community Dent Health 1988, 5:3-18.\",\n 0));\n\n }",
"class_method_signature": "diff_match_patchTest.testRefs()",
"constructor": false,
"full_signature": "@Test @Ignore // TODO fails diff_match_patchTest.testRefs:24 Pattern too long for this // application. public void testRefs()",
"identifier": "testRefs",
"invocations": [
"assertEquals",
"match_main"
],
"modifiers": "@Test @Ignore // TODO fails diff_match_patchTest.testRefs:24 Pattern too long for this // application. public",
"parameters": "()",
"return": "void",
"signature": "void testRefs()",
"testcase": true
} | {
"fields": [
{
"declarator": "Diff_Timeout = 1.0f",
"modifier": "private",
"original_string": "private float Diff_Timeout = 1.0f;",
"type": "float",
"var_name": "Diff_Timeout"
},
{
"declarator": "Diff_EditCost = 4",
"modifier": "private",
"original_string": "private short Diff_EditCost = 4;",
"type": "short",
"var_name": "Diff_EditCost"
},
{
"declarator": "Match_Threshold = 0.05f",
"modifier": "private static final",
"original_string": "private static final float Match_Threshold = 0.05f;",
"type": "float",
"var_name": "Match_Threshold"
},
{
"declarator": "Match_Distance = 1000",
"modifier": "private static final",
"original_string": "private static final int Match_Distance = 1000;",
"type": "int",
"var_name": "Match_Distance"
},
{
"declarator": "Patch_DeleteThreshold = 0.5f",
"modifier": "private static final",
"original_string": "private static final float Patch_DeleteThreshold = 0.5f;",
"type": "float",
"var_name": "Patch_DeleteThreshold"
},
{
"declarator": "Patch_Margin = 4",
"modifier": "private static final",
"original_string": "private static final short Patch_Margin = 4;",
"type": "short",
"var_name": "Patch_Margin"
},
{
"declarator": "Match_MaxBits = 32",
"modifier": "private static final",
"original_string": "private static final short Match_MaxBits = 32;",
"type": "short",
"var_name": "Match_MaxBits"
},
{
"declarator": "BLANKLINEEND = Pattern.compile(\"\\\\n\\\\r?\\\\n\\\\Z\",\n Pattern.DOTALL)",
"modifier": "private",
"original_string": "private Pattern BLANKLINEEND = Pattern.compile(\"\\\\n\\\\r?\\\\n\\\\Z\",\n Pattern.DOTALL);",
"type": "Pattern",
"var_name": "BLANKLINEEND"
},
{
"declarator": "BLANKLINESTART = Pattern.compile(\"\\\\A\\\\r?\\\\n\\\\r?\\\\n\",\n Pattern.DOTALL)",
"modifier": "private",
"original_string": "private Pattern BLANKLINESTART = Pattern.compile(\"\\\\A\\\\r?\\\\n\\\\r?\\\\n\",\n Pattern.DOTALL);",
"type": "Pattern",
"var_name": "BLANKLINESTART"
}
],
"file": "modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java",
"identifier": "diff_match_patch",
"interfaces": "",
"methods": [
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_main(String text1, String text2)",
"identifier": "diff_main",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2,\n boolean checklines)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines)",
"identifier": "diff_main",
"modifiers": "public",
"parameters": "(String text1, String text2,\n boolean checklines)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"identifier": "diff_main",
"modifiers": "private",
"parameters": "(String text1, String text2,\n boolean checklines, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_main(String text1, String text2,\n boolean checklines, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"identifier": "diff_compute",
"modifiers": "private",
"parameters": "(String text1, String text2,\n boolean checklines, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_compute(String text1, String text2,\n boolean checklines, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_lineMode(String text1, String text2,\n long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_lineMode(String text1, String text2,\n long deadline)",
"identifier": "diff_lineMode",
"modifiers": "private",
"parameters": "(String text1, String text2,\n long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_lineMode(String text1, String text2,\n long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_bisect(String text1, String text2,\n long deadline)",
"constructor": false,
"full_signature": "protected LinkedList<Diff> diff_bisect(String text1, String text2,\n long deadline)",
"identifier": "diff_bisect",
"modifiers": "protected",
"parameters": "(String text1, String text2,\n long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_bisect(String text1, String text2,\n long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"constructor": false,
"full_signature": "private LinkedList<Diff> diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"identifier": "diff_bisectSplit",
"modifiers": "private",
"parameters": "(String text1, String text2,\n int x, int y, long deadline)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_bisectSplit(String text1, String text2,\n int x, int y, long deadline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_linesToChars(String text1, String text2)",
"constructor": false,
"full_signature": "protected LinesToCharsResult diff_linesToChars(String text1, String text2)",
"identifier": "diff_linesToChars",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "LinesToCharsResult",
"signature": "LinesToCharsResult diff_linesToChars(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"constructor": false,
"full_signature": "private String diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"identifier": "diff_linesToCharsMunge",
"modifiers": "private",
"parameters": "(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"return": "String",
"signature": "String diff_linesToCharsMunge(String text, List<String> lineArray,\n Map<String, Integer> lineHash)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"constructor": false,
"full_signature": "protected void diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"identifier": "diff_charsToLines",
"modifiers": "protected",
"parameters": "(LinkedList<Diff> diffs,\n List<String> lineArray)",
"return": "void",
"signature": "void diff_charsToLines(LinkedList<Diff> diffs,\n List<String> lineArray)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonPrefix(String text1, String text2)",
"constructor": false,
"full_signature": "public int diff_commonPrefix(String text1, String text2)",
"identifier": "diff_commonPrefix",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonPrefix(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonSuffix(String text1, String text2)",
"constructor": false,
"full_signature": "public int diff_commonSuffix(String text1, String text2)",
"identifier": "diff_commonSuffix",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonSuffix(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_commonOverlap(String text1, String text2)",
"constructor": false,
"full_signature": "protected int diff_commonOverlap(String text1, String text2)",
"identifier": "diff_commonOverlap",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "int",
"signature": "int diff_commonOverlap(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_halfMatch(String text1, String text2)",
"constructor": false,
"full_signature": "protected String[] diff_halfMatch(String text1, String text2)",
"identifier": "diff_halfMatch",
"modifiers": "protected",
"parameters": "(String text1, String text2)",
"return": "String[]",
"signature": "String[] diff_halfMatch(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_halfMatchI(String longtext, String shorttext, int i)",
"constructor": false,
"full_signature": "private String[] diff_halfMatchI(String longtext, String shorttext, int i)",
"identifier": "diff_halfMatchI",
"modifiers": "private",
"parameters": "(String longtext, String shorttext, int i)",
"return": "String[]",
"signature": "String[] diff_halfMatchI(String longtext, String shorttext, int i)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemantic(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupSemantic(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupSemantic",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupSemantic(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupSemanticLossless",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupSemanticLossless(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupSemanticScore(String one, String two)",
"constructor": false,
"full_signature": "private int diff_cleanupSemanticScore(String one, String two)",
"identifier": "diff_cleanupSemanticScore",
"modifiers": "private",
"parameters": "(String one, String two)",
"return": "int",
"signature": "int diff_cleanupSemanticScore(String one, String two)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupEfficiency",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupEfficiency(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_cleanupMerge(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public void diff_cleanupMerge(LinkedList<Diff> diffs)",
"identifier": "diff_cleanupMerge",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "void",
"signature": "void diff_cleanupMerge(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_xIndex(LinkedList<Diff> diffs, int loc)",
"constructor": false,
"full_signature": "public int diff_xIndex(LinkedList<Diff> diffs, int loc)",
"identifier": "diff_xIndex",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs, int loc)",
"return": "int",
"signature": "int diff_xIndex(LinkedList<Diff> diffs, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_prettyHtml(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_prettyHtml(LinkedList<Diff> diffs)",
"identifier": "diff_prettyHtml",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_prettyHtml(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_text1(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_text1(LinkedList<Diff> diffs)",
"identifier": "diff_text1",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_text1(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_text2(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_text2(LinkedList<Diff> diffs)",
"identifier": "diff_text2",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_text2(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_levenshtein(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public int diff_levenshtein(LinkedList<Diff> diffs)",
"identifier": "diff_levenshtein",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "int",
"signature": "int diff_levenshtein(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_toDelta(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public String diff_toDelta(LinkedList<Diff> diffs)",
"identifier": "diff_toDelta",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "String",
"signature": "String diff_toDelta(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.diff_fromDelta(String text1, String delta)",
"constructor": false,
"full_signature": "public LinkedList<Diff> diff_fromDelta(String text1, String delta)",
"identifier": "diff_fromDelta",
"modifiers": "public",
"parameters": "(String text1, String delta)",
"return": "LinkedList<Diff>",
"signature": "LinkedList<Diff> diff_fromDelta(String text1, String delta)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_main(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "public static int match_main(String text, String pattern, int loc)",
"identifier": "match_main",
"modifiers": "public static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_main(String text, String pattern, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_bitap(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "protected static int match_bitap(String text, String pattern, int loc)",
"identifier": "match_bitap",
"modifiers": "protected static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_bitap(String text, String pattern, int loc)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_bitapScore(int e, int x, int loc, String pattern)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unused\") private static double match_bitapScore(int e, int x, int loc, String pattern)",
"identifier": "match_bitapScore",
"modifiers": "@SuppressWarnings(\"unused\") private static",
"parameters": "(int e, int x, int loc, String pattern)",
"return": "double",
"signature": "double match_bitapScore(int e, int x, int loc, String pattern)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.match_alphabet(String pattern)",
"constructor": false,
"full_signature": "protected static Map<Character, Integer> match_alphabet(String pattern)",
"identifier": "match_alphabet",
"modifiers": "protected static",
"parameters": "(String pattern)",
"return": "Map<Character, Integer>",
"signature": "Map<Character, Integer> match_alphabet(String pattern)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_addContext(Patch patch, String text)",
"constructor": false,
"full_signature": "protected void patch_addContext(Patch patch, String text)",
"identifier": "patch_addContext",
"modifiers": "protected",
"parameters": "(Patch patch, String text)",
"return": "void",
"signature": "void patch_addContext(Patch patch, String text)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, String text2)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, String text2)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, String text2)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, String text2)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, String text2,\n LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, String text2,\n LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_make(String text1, LinkedList<Diff> diffs)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs)",
"identifier": "patch_make",
"modifiers": "public",
"parameters": "(String text1, LinkedList<Diff> diffs)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_deepCopy(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches)",
"identifier": "patch_deepCopy",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "LinkedList<Patch>",
"signature": "LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_apply(LinkedList<Patch> patches, String text)",
"constructor": false,
"full_signature": "public Object[] patch_apply(LinkedList<Patch> patches, String text)",
"identifier": "patch_apply",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches, String text)",
"return": "Object[]",
"signature": "Object[] patch_apply(LinkedList<Patch> patches, String text)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_addPadding(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public String patch_addPadding(LinkedList<Patch> patches)",
"identifier": "patch_addPadding",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "String",
"signature": "String patch_addPadding(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_splitMax(LinkedList<Patch> patches)",
"constructor": false,
"full_signature": "public void patch_splitMax(LinkedList<Patch> patches)",
"identifier": "patch_splitMax",
"modifiers": "public",
"parameters": "(LinkedList<Patch> patches)",
"return": "void",
"signature": "void patch_splitMax(LinkedList<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_toText(List<Patch> patches)",
"constructor": false,
"full_signature": "public String patch_toText(List<Patch> patches)",
"identifier": "patch_toText",
"modifiers": "public",
"parameters": "(List<Patch> patches)",
"return": "String",
"signature": "String patch_toText(List<Patch> patches)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.patch_fromText(String textline)",
"constructor": false,
"full_signature": "public List<Patch> patch_fromText(String textline)",
"identifier": "patch_fromText",
"modifiers": "public",
"parameters": "(String textline)",
"return": "List<Patch>",
"signature": "List<Patch> patch_fromText(String textline)",
"testcase": false
},
{
"class_method_signature": "diff_match_patch.unescapeForEncodeUriCompatability(String str)",
"constructor": false,
"full_signature": "private static String unescapeForEncodeUriCompatability(String str)",
"identifier": "unescapeForEncodeUriCompatability",
"modifiers": "private static",
"parameters": "(String str)",
"return": "String",
"signature": "String unescapeForEncodeUriCompatability(String str)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static int match_main(String text, String pattern, int loc) {\n // Check for null inputs.\n if (text == null || pattern == null) {\n throw new IllegalArgumentException(\"Null inputs. (match_main)\");\n }\n\n loc = Math.max(0, Math.min(loc, text.length()));\n if (text.equals(pattern)) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (text.length() == 0) {\n // Nothing to match.\n return -1;\n } else if (loc + pattern.length() <= text.length()\n && text.substring(loc, loc + pattern.length()).equals(pattern)) {\n // Perfect match at the perfect spot! (Includes case of null\n // pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return match_bitap(text, pattern, loc);\n }\n }",
"class_method_signature": "diff_match_patch.match_main(String text, String pattern, int loc)",
"constructor": false,
"full_signature": "public static int match_main(String text, String pattern, int loc)",
"identifier": "match_main",
"invocations": [
"max",
"min",
"length",
"equals",
"length",
"length",
"length",
"equals",
"substring",
"length",
"match_bitap"
],
"modifiers": "public static",
"parameters": "(String text, String pattern, int loc)",
"return": "int",
"signature": "int match_main(String text, String pattern, int loc)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_87 | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelperTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"modifier": "",
"original_string": "String haystack = \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\";",
"type": "String",
"var_name": "haystack"
}
],
"file": "modules/bluima_text2pmid/src/test/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelperTest.java",
"identifier": "LuceneHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimilarity() {\n\n Map<Integer, String> haystack = newHashMap();\n haystack.put(\n 1,\n \"This is a remarkably good book on graphical models. Filled with lots of examples and really takes its time trying to build intuition. Seriously, consider this book if the idea of going through Koller’s 1400 page tome feels intimidating. The book is more gentle than the others listed here but still manages a remarkable amount. Note it says Bayesian in the title so non-Bayesian algorithms and models are mostly ignored. You will need to supplement with a book like EoSL or Murphy’s book. There is a free copy on his website so be sure to preview and see if its at the right level for you.\");\n haystack.put(2, \"This is remarkably good book on graphical models\");\n haystack.put(3, \"This is remarkably good book on models\");\n haystack.put(4, \"what a mistake to go fishing last saturday\");\n\n Map<Integer, Float> similarities = LuceneHelper.computeSimilarity(\n haystack, \"This is a remarkably good book on graphical models\", 3);\n\n float s1 = similarities.get(1), s2 = similarities.get(2), s3 = similarities\n .get(3), s4 = similarities.get(4);\n LOG.debug(\"\\ns1 {}\\ns2 {}\\ns3 {}\\ns4 {}\",\n new Object[] { s1, s2, s3, s4 });\n\n assertTrue(\"we have a match\", s1 > 0);\n assertTrue(\"we have a match\", s2 > 0);\n assertTrue(\"we have a match\", s3 > 0);\n assertTrue(\"no match\", s4 == 0);\n\n assertTrue(s2 > s1);\n assertTrue(s2 > s3);\n }",
"class_method_signature": "LuceneHelperTest.testSimilarity()",
"constructor": false,
"full_signature": "@Test public void testSimilarity()",
"identifier": "testSimilarity",
"invocations": [
"newHashMap",
"put",
"put",
"put",
"put",
"computeSimilarity",
"get",
"get",
"get",
"get",
"debug",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue",
"assertTrue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSimilarity()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(LuceneHelper.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = getLogger(LuceneHelper.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "CONTENT_FIELD = \"text\"",
"modifier": "private static final",
"original_string": "private static final String CONTENT_FIELD = \"text\";",
"type": "String",
"var_name": "CONTENT_FIELD"
},
{
"declarator": "ID_FIELD = \"id\"",
"modifier": "private static final",
"original_string": "private static final String ID_FIELD = \"id\";",
"type": "String",
"var_name": "ID_FIELD"
},
{
"declarator": "anal = new StandardAnalyzer(Version.LUCENE_41)",
"modifier": "private static final",
"original_string": "private static final Analyzer anal = new StandardAnalyzer(Version.LUCENE_41);",
"type": "Analyzer",
"var_name": "anal"
},
{
"declarator": "parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal)",
"modifier": "private static final",
"original_string": "private static final QueryParser parser = new QueryParser(LUCENE_41,\n CONTENT_FIELD, anal);",
"type": "QueryParser",
"var_name": "parser"
}
],
"file": "modules/bluima_text2pmid/src/main/java/ch/epfl/bbp/uima/txt2pmid/LuceneHelper.java",
"identifier": "LuceneHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"identifier": "computeSimilarity2",
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity2(\n final Map<Integer, String> queries, String haystack, int gramLength)",
"testcase": false
},
{
"class_method_signature": "LuceneHelper.subsumes(String haystack, final String needle)",
"constructor": false,
"full_signature": "public static float subsumes(String haystack, final String needle)",
"identifier": "subsumes",
"modifiers": "public static",
"parameters": "(String haystack, final String needle)",
"return": "float",
"signature": "float subsumes(String haystack, final String needle)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength) {\n\n if (corpus == null || corpus.isEmpty() || needle == null\n || needle.length() == 0)\n return null;\n\n try {\n // index the cleaned text\n RAMDirectory idx = new RAMDirectory();\n IndexWriterConfig iwc = new IndexWriterConfig(LUCENE_41, anal);\n IndexWriter writer = new IndexWriter(idx, iwc);\n\n // index\n for (Entry<Integer, String> entry : corpus.entrySet()) {\n Document doc = new Document();\n doc.add(new IntField(ID_FIELD, entry.getKey(), Store.YES));\n doc.add(new TextField(CONTENT_FIELD, entry.getValue(),\n Store.YES));\n writer.addDocument(doc);\n }\n writer.close();\n\n // search\n IndexReader reader = open(idx);\n Query query = parser.parse(getNGram(needle, gramLength));\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs results = searcher.search(query, 20);\n\n Map<Integer, Float> ret = newHashMap();\n for (ScoreDoc hit : results.scoreDocs) {\n Document doc = searcher.doc(hit.doc);\n int id = new Integer(doc.get(ID_FIELD));\n ret.put(id, hit.score);\n }\n reader.close();\n\n // ensure all keys are mapped, add 0 otherwise\n for (Integer corpusId : corpus.keySet()) {\n if (!ret.containsKey(corpusId))\n ret.put(corpusId, 0f);\n }\n return ret;\n\n } catch (Exception e) {\n LOG.warn(\"could not computeSimilarity for \" + needle, e);\n }\n return null;\n }",
"class_method_signature": "LuceneHelper.computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"constructor": false,
"full_signature": "public static Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"identifier": "computeSimilarity",
"invocations": [
"isEmpty",
"length",
"entrySet",
"add",
"getKey",
"add",
"getValue",
"addDocument",
"close",
"open",
"parse",
"getNGram",
"search",
"newHashMap",
"doc",
"get",
"put",
"close",
"keySet",
"containsKey",
"put",
"warn"
],
"modifiers": "public static",
"parameters": "(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"return": "Map<Integer, Float>",
"signature": "Map<Integer, Float> computeSimilarity(\n final Map<Integer, String> corpus, String needle, int gramLength)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_68 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCantDeleteSomethingThatDoesntExist() {\n RadixTreeImpl<String> trie = new RadixTreeImpl<String>();\n assertFalse(trie.delete(\"apple\"));\n }",
"class_method_signature": "RadixTreeImplTest.testCantDeleteSomethingThatDoesntExist()",
"constructor": false,
"full_signature": "@Test public void testCantDeleteSomethingThatDoesntExist()",
"identifier": "testCantDeleteSomethingThatDoesntExist",
"invocations": [
"assertFalse",
"delete"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCantDeleteSomethingThatDoesntExist()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean delete(String key) {\n Visitor<T, Boolean> visitor = new VisitorImpl<T, Boolean>(Boolean.FALSE) {\n public void visit(String key, RadixTreeNode<T> parent,\n RadixTreeNode<T> node) {\n result = node.isReal();\n\n // if it is a real node\n if (result) {\n // If there no children of the node we need to\n // delete it from the its parent children list\n if (node.getChildern().size() == 0) {\n Iterator<RadixTreeNode<T>> it = parent.getChildern()\n .iterator();\n while (it.hasNext()) {\n if (it.next().getKey().equals(node.getKey())) {\n it.remove();\n break;\n }\n }\n\n // if parent is not real node and has only one child\n // then they need to be merged.\n if (parent.getChildern().size() == 1\n && parent.isReal() == false) {\n mergeNodes(parent, parent.getChildern().get(0));\n }\n } else if (node.getChildern().size() == 1) {\n // we need to merge the only child of this node with\n // itself\n mergeNodes(node, node.getChildern().get(0));\n } else { // we jus need to mark the node as non real.\n node.setReal(false);\n }\n }\n }\n\n /**\n * Merge a child into its parent node. Operation only valid if it is\n * only child of the parent node and parent node is not a real node.\n * \n * @param parent\n * The parent Node\n * @param child\n * The child Node\n */\n private void mergeNodes(RadixTreeNode<T> parent,\n RadixTreeNode<T> child) {\n parent.setKey(parent.getKey() + child.getKey());\n parent.setReal(child.isReal());\n parent.setValue(child.getValue());\n parent.setChildern(child.getChildern());\n }\n\n };\n \n visit(key, visitor);\n \n if(visitor.getResult()) {\n \tsize--;\n }\n return visitor.getResult().booleanValue();\n }",
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"invocations": [
"isReal",
"size",
"getChildern",
"iterator",
"getChildern",
"hasNext",
"equals",
"getKey",
"next",
"getKey",
"remove",
"size",
"getChildern",
"isReal",
"mergeNodes",
"get",
"getChildern",
"size",
"getChildern",
"mergeNodes",
"get",
"getChildern",
"setReal",
"setKey",
"getKey",
"getKey",
"setReal",
"isReal",
"setValue",
"getValue",
"setChildern",
"getChildern",
"visit",
"getResult",
"booleanValue",
"getResult"
],
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_5 | {
"fields": [],
"file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/NeuronamesXmlParserTest.java",
"identifier": "NeuronamesXmlParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception {\n Map<String, Concept> nn = NeuronamesXmlParser.parse();\n assertEquals(2861, nn.size());\n\n Concept brain = nn.get(\"brain\");\n assertNotNull(brain);\n assertEquals(5, brain.getVariants().size());\n }",
"class_method_signature": "NeuronamesXmlParserTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"parse",
"assertEquals",
"size",
"get",
"assertNotNull",
"assertEquals",
"size",
"getVariants"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [],
"file": "modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/NeuronamesXmlParser.java",
"identifier": "NeuronamesXmlParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "NeuronamesXmlParser.parse()",
"constructor": false,
"full_signature": "public static Map<String, Concept> parse()",
"identifier": "parse",
"modifiers": "public static",
"parameters": "()",
"return": "Map<String, Concept>",
"signature": "Map<String, Concept> parse()",
"testcase": false
},
{
"class_method_signature": "NeuronamesXmlParser.parse(File f)",
"constructor": false,
"full_signature": "public static Map<String, Concept> parse(File f)",
"identifier": "parse",
"modifiers": "public static",
"parameters": "(File f)",
"return": "Map<String, Concept>",
"signature": "Map<String, Concept> parse(File f)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<String, Concept> parse() throws JDOMException,\n\t\t\tIOException {\n\t\treturn parse(new File(XmlHelper.XML_RESOURCES\n\t\t\t\t+ \"neuronames/NeuroNames.xml\"));\n\t}",
"class_method_signature": "NeuronamesXmlParser.parse()",
"constructor": false,
"full_signature": "public static Map<String, Concept> parse()",
"identifier": "parse",
"invocations": [
"parse"
],
"modifiers": "public static",
"parameters": "()",
"return": "Map<String, Concept>",
"signature": "Map<String, Concept> parse()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_48 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/io/DirectoryIteratorTest.java",
"identifier": "DirectoryIteratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefault() throws Exception {\n\n File dir = Resources.getFile(\"directoryIterator/default\");\n Iterator<File> it = DirectoryIterator.get(\n DefaultDirectoryIterator.class.getSimpleName(), dir, null,\n false);\n ArrayList<File> list = newArrayList(it);\n assertEquals(3, list.size());\n assertEquals(\"test\", asText(list.get(0)).substring(0, 4));\n\n it = DirectoryIterator.get(\n DefaultDirectoryIterator.class.getSimpleName(), dir, \"tm\",\n false);\n list = Lists.newArrayList(it);\n assertEquals(1, list.size());\n }",
"class_method_signature": "DirectoryIteratorTest.testDefault()",
"constructor": false,
"full_signature": "@Test public void testDefault()",
"identifier": "testDefault",
"invocations": [
"getFile",
"get",
"getSimpleName",
"newArrayList",
"assertEquals",
"size",
"assertEquals",
"substring",
"asText",
"get",
"get",
"getSimpleName",
"newArrayList",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDefault()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(DirectoryIterator.class)",
"modifier": "protected static",
"original_string": "protected static Logger LOG = LoggerFactory\n .getLogger(DirectoryIterator.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "LARGE = LargeDirectoryIterator.class\n .getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String LARGE = LargeDirectoryIterator.class\n .getSimpleName();",
"type": "String",
"var_name": "LARGE"
},
{
"declarator": "ZIP = ZipDirectoryIterator.class.getSimpleName()",
"modifier": "public static final",
"original_string": "public static final String ZIP = ZipDirectoryIterator.class.getSimpleName();",
"type": "String",
"var_name": "ZIP"
},
{
"declarator": "dir",
"modifier": "protected",
"original_string": "protected File dir;",
"type": "File",
"var_name": "dir"
},
{
"declarator": "extensionFilter = null",
"modifier": "protected",
"original_string": "protected String extensionFilter = null;",
"type": "String",
"var_name": "extensionFilter"
},
{
"declarator": "isRecursive = false",
"modifier": "protected",
"original_string": "protected boolean isRecursive = false;",
"type": "boolean",
"var_name": "isRecursive"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/io/DirectoryIterator.java",
"identifier": "DirectoryIterator",
"interfaces": "",
"methods": [
{
"class_method_signature": "DirectoryIterator.DirectoryIterator()",
"constructor": true,
"full_signature": "public DirectoryIterator()",
"identifier": "DirectoryIterator",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DirectoryIterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setDirectory(File dir)",
"constructor": false,
"full_signature": "public DirectoryIterator setDirectory(File dir)",
"identifier": "setDirectory",
"modifiers": "public",
"parameters": "(File dir)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setDirectory(File dir)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setExtensionFilter(String ext)",
"constructor": false,
"full_signature": "public DirectoryIterator setExtensionFilter(String ext)",
"identifier": "setExtensionFilter",
"modifiers": "public",
"parameters": "(String ext)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setExtensionFilter(String ext)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.setRecursive(boolean isRecursive)",
"constructor": false,
"full_signature": "public DirectoryIterator setRecursive(boolean isRecursive)",
"identifier": "setRecursive",
"modifiers": "public",
"parameters": "(boolean isRecursive)",
"return": "DirectoryIterator",
"signature": "DirectoryIterator setRecursive(boolean isRecursive)",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.iterator()",
"constructor": false,
"full_signature": "public abstract Iterator<File> iterator()",
"identifier": "iterator",
"modifiers": "public abstract",
"parameters": "()",
"return": "Iterator<File>",
"signature": "Iterator<File> iterator()",
"testcase": false
},
{
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive) throws IOException {\n\n try {\n // add package name to e.g. \"DefaultDirectoryIterator\"\n if (directoryIteratorType.indexOf('.') == -1) {\n directoryIteratorType = DirectoryIterator.class.getPackage()\n .getName() + \".\" + directoryIteratorType;\n }\n\n DirectoryIterator it = (DirectoryIterator) Class.forName(\n directoryIteratorType).newInstance();\n it.setDirectory(dir);\n it.setRecursive(recursive);\n\n if (extensionFilter != null)\n it.setExtensionFilter(extensionFilter);\n return it.iterator();\n } catch (Throwable t) {\n throw new IOException(t);\n }\n }",
"class_method_signature": "DirectoryIterator.get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"constructor": false,
"full_signature": "public static Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"identifier": "get",
"invocations": [
"indexOf",
"getName",
"getPackage",
"newInstance",
"forName",
"setDirectory",
"setRecursive",
"setExtensionFilter",
"iterator"
],
"modifiers": "public static",
"parameters": "(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"return": "Iterator<File>",
"signature": "Iterator<File> get(String directoryIteratorType, File dir,\n String extensionFilter, boolean recursive)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_109 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/HistogramTest.java",
"identifier": "HistogramTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAdd() throws Exception {\n\n Histogram<String> h = new Histogram<String>();\n h.add(\"a\", 10);\n h.add(\"b\", 100);\n h.add(\"c\", 1000);\n\n Histogram<String> h2 = new Histogram<String>();\n h2.add(\"a\", 1);\n h2.add(\"b\", 2);\n h2.add(\"c\", 3);\n\n h.add(h2);\n assertEquals(11, h.getCount(\"a\").intValue());\n assertEquals(102, h.getCount(\"b\").intValue());\n }",
"class_method_signature": "HistogramTest.testAdd()",
"constructor": false,
"full_signature": "@Test public void testAdd()",
"identifier": "testAdd",
"invocations": [
"add",
"add",
"add",
"add",
"add",
"add",
"add",
"assertEquals",
"intValue",
"getCount",
"assertEquals",
"intValue",
"getCount"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAdd()",
"testcase": true
} | {
"fields": [
{
"declarator": "map = new HashMap<T, Long>()",
"modifier": "",
"original_string": "Map<T, Long> map = new HashMap<T, Long>();",
"type": "Map<T, Long>",
"var_name": "map"
}
],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/Histogram.java",
"identifier": "Histogram",
"interfaces": "",
"methods": [
{
"class_method_signature": "Histogram.add(T value)",
"constructor": false,
"full_signature": "public void add(T value)",
"identifier": "add",
"modifiers": "public",
"parameters": "(T value)",
"return": "void",
"signature": "void add(T value)",
"testcase": false
},
{
"class_method_signature": "Histogram.add(T value, int times)",
"constructor": false,
"full_signature": "public void add(T value, int times)",
"identifier": "add",
"modifiers": "public",
"parameters": "(T value, int times)",
"return": "void",
"signature": "void add(T value, int times)",
"testcase": false
},
{
"class_method_signature": "Histogram.getCount(T value)",
"constructor": false,
"full_signature": "public Long getCount(T value)",
"identifier": "getCount",
"modifiers": "public",
"parameters": "(T value)",
"return": "Long",
"signature": "Long getCount(T value)",
"testcase": false
},
{
"class_method_signature": "Histogram.getMap()",
"constructor": false,
"full_signature": "public Map<T, Long> getMap()",
"identifier": "getMap",
"modifiers": "public",
"parameters": "()",
"return": "Map<T, Long>",
"signature": "Map<T, Long> getMap()",
"testcase": false
},
{
"class_method_signature": "Histogram.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int size()",
"testcase": false
},
{
"class_method_signature": "Histogram.totalSize()",
"constructor": false,
"full_signature": "public Long totalSize()",
"identifier": "totalSize",
"modifiers": "public",
"parameters": "()",
"return": "Long",
"signature": "Long totalSize()",
"testcase": false
},
{
"class_method_signature": "Histogram.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "Histogram.cutAtMin(final int minCount)",
"constructor": false,
"full_signature": "public void cutAtMin(final int minCount)",
"identifier": "cutAtMin",
"modifiers": "public",
"parameters": "(final int minCount)",
"return": "void",
"signature": "void cutAtMin(final int minCount)",
"testcase": false
},
{
"class_method_signature": "Histogram.add(Histogram<T> anotherHistogram)",
"constructor": false,
"full_signature": "public void add(Histogram<T> anotherHistogram)",
"identifier": "add",
"modifiers": "public",
"parameters": "(Histogram<T> anotherHistogram)",
"return": "void",
"signature": "void add(Histogram<T> anotherHistogram)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void add(T value) {\n if (value == null)\n return;\n\n if (map.containsKey(value)) {\n map.put(value, map.get(value) + 1);\n } else {\n map.put(value, 1l);\n }\n }",
"class_method_signature": "Histogram.add(T value)",
"constructor": false,
"full_signature": "public void add(T value)",
"identifier": "add",
"invocations": [
"containsKey",
"put",
"get",
"put"
],
"modifiers": "public",
"parameters": "(T value)",
"return": "void",
"signature": "void add(T value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_72 | {
"fields": [
{
"declarator": "trie",
"modifier": "",
"original_string": "RadixTreeImpl<String> trie;",
"type": "RadixTreeImpl<String>",
"var_name": "trie"
}
],
"file": "modules/bluima_utils/src/test/java/ds/tree/RadixTreeImplTest.java",
"identifier": "RadixTreeImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetSize() {\n trie.insert(\"apple\", \"apple\");\n trie.insert(\"appleshack\", \"appleshack\");\n trie.insert(\"appleshackcream\", \"appleshackcream\");\n trie.insert(\"applepie\", \"applepie\");\n trie.insert(\"ape\", \"ape\");\n \n assertTrue(trie.getSize() == 5);\n }",
"class_method_signature": "RadixTreeImplTest.testGetSize()",
"constructor": false,
"full_signature": "@Test public void testGetSize()",
"identifier": "testGetSize",
"invocations": [
"insert",
"insert",
"insert",
"insert",
"insert",
"assertTrue",
"getSize"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetSize()",
"testcase": true
} | {
"fields": [
{
"declarator": "root",
"modifier": "protected",
"original_string": "protected RadixTreeNode<T> root;",
"type": "RadixTreeNode<T>",
"var_name": "root"
},
{
"declarator": "size",
"modifier": "protected",
"original_string": "protected long size;",
"type": "long",
"var_name": "size"
}
],
"file": "modules/bluima_utils/src/main/java/ds/tree/RadixTreeImpl.java",
"identifier": "RadixTreeImpl",
"interfaces": "implements RadixTree<T>, Formattable",
"methods": [
{
"class_method_signature": "RadixTreeImpl.RadixTreeImpl()",
"constructor": true,
"full_signature": "public RadixTreeImpl()",
"identifier": "RadixTreeImpl",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " RadixTreeImpl()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.find(String key)",
"constructor": false,
"full_signature": "public T find(String key)",
"identifier": "find",
"modifiers": "public",
"parameters": "(String key)",
"return": "T",
"signature": "T find(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.delete(String key)",
"constructor": false,
"full_signature": "public boolean delete(String key)",
"identifier": "delete",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean delete(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, T value)",
"constructor": false,
"full_signature": "public void insert(String key, T value)",
"identifier": "insert",
"modifiers": "public",
"parameters": "(String key, T value)",
"return": "void",
"signature": "void insert(String key, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.insert(String key, RadixTreeNode<T> node, T value)",
"constructor": false,
"full_signature": "private void insert(String key, RadixTreeNode<T> node, T value)",
"identifier": "insert",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, T value)",
"return": "void",
"signature": "void insert(String key, RadixTreeNode<T> node, T value)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPrefix(String key, int recordLimit)",
"constructor": false,
"full_signature": "public ArrayList<T> searchPrefix(String key, int recordLimit)",
"identifier": "searchPrefix",
"modifiers": "public",
"parameters": "(String key, int recordLimit)",
"return": "ArrayList<T>",
"signature": "ArrayList<T> searchPrefix(String key, int recordLimit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"constructor": false,
"full_signature": "private void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"identifier": "getNodes",
"modifiers": "private",
"parameters": "(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"return": "void",
"signature": "void getNodes(RadixTreeNode<T> parent, ArrayList<T> keys, int limit)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.searchPefix(String key, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"identifier": "searchPefix",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node)",
"return": "RadixTreeNode<T>",
"signature": "RadixTreeNode<T> searchPefix(String key, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.contains(String key)",
"constructor": false,
"full_signature": "public boolean contains(String key)",
"identifier": "contains",
"modifiers": "public",
"parameters": "(String key)",
"return": "boolean",
"signature": "boolean contains(String key)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String key, Visitor<T, R> visitor)",
"constructor": false,
"full_signature": "public void visit(String key, Visitor<T, R> visitor)",
"identifier": "visit",
"modifiers": "public",
"parameters": "(String key, Visitor<T, R> visitor)",
"return": "void",
"signature": "void visit(String key, Visitor<T, R> visitor)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"identifier": "visit",
"modifiers": "private",
"parameters": "(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"return": "void",
"signature": "void visit(String prefix, Visitor<T, R> visitor,\n RadixTreeNode<T> parent, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display()",
"constructor": false,
"full_signature": "@Deprecated public void display()",
"identifier": "display",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "void",
"signature": "void display()",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.display(int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "@Deprecated private void display(int level, RadixTreeNode<T> node)",
"identifier": "display",
"modifiers": "@Deprecated private",
"parameters": "(int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void display(int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"constructor": false,
"full_signature": "private void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"identifier": "formatNodeTo",
"modifiers": "private",
"parameters": "(Formatter f, int level, RadixTreeNode<T> node)",
"return": "void",
"signature": "void formatNodeTo(Formatter f, int level, RadixTreeNode<T> node)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.formatTo(Formatter formatter, int flags, int width, int precision)",
"constructor": false,
"full_signature": "@Override public void formatTo(Formatter formatter, int flags, int width, int precision)",
"identifier": "formatTo",
"modifiers": "@Override public",
"parameters": "(Formatter formatter, int flags, int width, int precision)",
"return": "void",
"signature": "void formatTo(Formatter formatter, int flags, int width, int precision)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String prefix)",
"constructor": false,
"full_signature": "public String complete(String prefix)",
"identifier": "complete",
"modifiers": "public",
"parameters": "(String prefix)",
"return": "String",
"signature": "String complete(String prefix)",
"testcase": false
},
{
"class_method_signature": "RadixTreeImpl.complete(String key, RadixTreeNode<T> node, String base)",
"constructor": false,
"full_signature": "private String complete(String key, RadixTreeNode<T> node, String base)",
"identifier": "complete",
"modifiers": "private",
"parameters": "(String key, RadixTreeNode<T> node, String base)",
"return": "String",
"signature": "String complete(String key, RadixTreeNode<T> node, String base)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public long getSize() {\n return size;\n }",
"class_method_signature": "RadixTreeImpl.getSize()",
"constructor": false,
"full_signature": "public long getSize()",
"identifier": "getSize",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getSize()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_25 | {
"fields": [
{
"declarator": "LOG = getLogger(PdfCollectionReaderTest.class)",
"modifier": "",
"original_string": "Logger LOG = getLogger(PdfCollectionReaderTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_pdf/src/test/java/ch/epfl/bbp/uima/pdf/cr/PdfCollectionReaderTest.java",
"identifier": "PdfCollectionReaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n // TODO fails\n public void tesTextractReferencesNaively() throws Exception {\n assertFalse(extractReferencesNaively(getTestCas(\"no\\nrefs\\nhere\")));\n assertTrue(extractReferencesNaively(getTestCas(\"some\\nReferences\\nhere\")));\n }",
"class_method_signature": "PdfCollectionReaderTest.tesTextractReferencesNaively()",
"constructor": false,
"full_signature": "@Test @Ignore // TODO fails public void tesTextractReferencesNaively()",
"identifier": "tesTextractReferencesNaively",
"invocations": [
"assertFalse",
"extractReferencesNaively",
"getTestCas",
"assertTrue",
"extractReferencesNaively",
"getTestCas"
],
"modifiers": "@Test @Ignore // TODO fails public",
"parameters": "()",
"return": "void",
"signature": "void tesTextractReferencesNaively()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(PdfCollectionReader.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory\n .getLogger(PdfCollectionReader.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "COMPONENT_ID = PdfCollectionReader.class\n .getName()",
"modifier": "public static final",
"original_string": "public static final String COMPONENT_ID = PdfCollectionReader.class\n .getName();",
"type": "String",
"var_name": "COMPONENT_ID"
},
{
"declarator": "PARAM_EXTRACT_TABLES = \"extractTables\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_EXTRACT_TABLES = \"extractTables\";",
"type": "String",
"var_name": "PARAM_EXTRACT_TABLES"
},
{
"declarator": "extractTables",
"modifier": "@ConfigurationParameter(name = PARAM_EXTRACT_TABLES, defaultValue = \"false\", //\n description = \"whether to extract tables\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_EXTRACT_TABLES, defaultValue = \"false\", //\n description = \"whether to extract tables\")\n private boolean extractTables;",
"type": "boolean",
"var_name": "extractTables"
},
{
"declarator": "PARAM_EXPAND_ABBREVIATIONS = \"expandAbbrevs\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_EXPAND_ABBREVIATIONS = \"expandAbbrevs\";",
"type": "String",
"var_name": "PARAM_EXPAND_ABBREVIATIONS"
},
{
"declarator": "expandAbbrevs",
"modifier": "@ConfigurationParameter(name = PARAM_EXPAND_ABBREVIATIONS, defaultValue = \"false\", //\n description = \"whether to expand Abbreviations\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_EXPAND_ABBREVIATIONS, defaultValue = \"false\", //\n description = \"whether to expand Abbreviations\")\n private boolean expandAbbrevs;",
"type": "boolean",
"var_name": "expandAbbrevs"
},
{
"declarator": "PARAM_EXTRACT_REFERENCES = \"extractReferences\"",
"modifier": "public static final",
"original_string": "public static final String PARAM_EXTRACT_REFERENCES = \"extractReferences\";",
"type": "String",
"var_name": "PARAM_EXTRACT_REFERENCES"
},
{
"declarator": "extractReferences",
"modifier": "@ConfigurationParameter(name = PARAM_EXTRACT_REFERENCES, defaultValue = \"false\", //\n description = \"whether to extract references\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_EXTRACT_REFERENCES, defaultValue = \"false\", //\n description = \"whether to extract references\")\n private boolean extractReferences;",
"type": "boolean",
"var_name": "extractReferences"
},
{
"declarator": "tableExtractor",
"modifier": "private",
"original_string": "private TableExtractor tableExtractor;",
"type": "TableExtractor",
"var_name": "tableExtractor"
},
{
"declarator": "REFERENCES = Pattern\n .compile(\"^(?:REFERENCES|References)\")",
"modifier": "private static final",
"original_string": "private static final Pattern REFERENCES = Pattern\n .compile(\"^(?:REFERENCES|References)\");",
"type": "Pattern",
"var_name": "REFERENCES"
}
],
"file": "modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/cr/PdfCollectionReader.java",
"identifier": "PdfCollectionReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "PdfCollectionReader.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.getNext(JCas jcas)",
"constructor": false,
"full_signature": "@Override public void getNext(JCas jcas)",
"identifier": "getNext",
"modifiers": "@Override public",
"parameters": "(JCas jcas)",
"return": "void",
"signature": "void getNext(JCas jcas)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.extractText(JCas jcas, BDocument bDocument,\n String docId, boolean expandAbbrevs)",
"constructor": false,
"full_signature": "public static void extractText(JCas jcas, BDocument bDocument,\n String docId, boolean expandAbbrevs)",
"identifier": "extractText",
"modifiers": "public static",
"parameters": "(JCas jcas, BDocument bDocument,\n String docId, boolean expandAbbrevs)",
"return": "void",
"signature": "void extractText(JCas jcas, BDocument bDocument,\n String docId, boolean expandAbbrevs)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.cleanupText(BBlock block, String docId)",
"constructor": false,
"full_signature": "private static String cleanupText(BBlock block, String docId)",
"identifier": "cleanupText",
"modifiers": "private static",
"parameters": "(BBlock block, String docId)",
"return": "String",
"signature": "String cleanupText(BBlock block, String docId)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.extractTables(TableExtractor extractor, File f, JCas jcas)",
"constructor": false,
"full_signature": "static void extractTables(TableExtractor extractor, File f, JCas jcas)",
"identifier": "extractTables",
"modifiers": "static",
"parameters": "(TableExtractor extractor, File f, JCas jcas)",
"return": "void",
"signature": "void extractTables(TableExtractor extractor, File f, JCas jcas)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.extractReferencesNaively(JCas jCas)",
"constructor": false,
"full_signature": "static boolean extractReferencesNaively(JCas jCas)",
"identifier": "extractReferencesNaively",
"modifiers": "static",
"parameters": "(JCas jCas)",
"return": "boolean",
"signature": "boolean extractReferencesNaively(JCas jCas)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.printHtml(JCas jcas, File file)",
"constructor": false,
"full_signature": "public static void printHtml(JCas jcas, File file)",
"identifier": "printHtml",
"modifiers": "public static",
"parameters": "(JCas jcas, File file)",
"return": "void",
"signature": "void printHtml(JCas jcas, File file)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.serializeXMLDocument(Document doc, Writer output)",
"constructor": false,
"full_signature": "public static void serializeXMLDocument(Document doc, Writer output)",
"identifier": "serializeXMLDocument",
"modifiers": "public static",
"parameters": "(Document doc, Writer output)",
"return": "void",
"signature": "void serializeXMLDocument(Document doc, Writer output)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.addElem(Element addTo, String name,\n String... attribs)",
"constructor": false,
"full_signature": "private static Element addElem(Element addTo, String name,\n String... attribs)",
"identifier": "addElem",
"modifiers": "private static",
"parameters": "(Element addTo, String name,\n String... attribs)",
"return": "Element",
"signature": "Element addElem(Element addTo, String name,\n String... attribs)",
"testcase": false
},
{
"class_method_signature": "PdfCollectionReader.buildTextElt(Document doc, String elttype,\n String contents, Map<String, String> attributes)",
"constructor": false,
"full_signature": "private static Element buildTextElt(Document doc, String elttype,\n String contents, Map<String, String> attributes)",
"identifier": "buildTextElt",
"modifiers": "private static",
"parameters": "(Document doc, String elttype,\n String contents, Map<String, String> attributes)",
"return": "Element",
"signature": "Element buildTextElt(Document doc, String elttype,\n String contents, Map<String, String> attributes)",
"testcase": false
}
],
"superclass": "extends AbstractFileReader"
} | {
"body": "static boolean extractReferencesNaively(JCas jCas) {\n\n // match potential sections\n List<Section> sections = newArrayList();\n Matcher m = REFERENCES.matcher(jCas.getDocumentText());\n while (m.find()) {\n Section section = new Section(jCas, m.start(), m.end());\n section.setSectionType(BlueUima.SECTION_TYPE_REFERENCES);\n sections.add(section);\n }\n\n if (sections.size() == 1) {\n sections.get(0).addToIndexes();\n return true;\n }\n return false;\n }",
"class_method_signature": "PdfCollectionReader.extractReferencesNaively(JCas jCas)",
"constructor": false,
"full_signature": "static boolean extractReferencesNaively(JCas jCas)",
"identifier": "extractReferencesNaively",
"invocations": [
"newArrayList",
"matcher",
"getDocumentText",
"find",
"start",
"end",
"setSectionType",
"add",
"size",
"addToIndexes",
"get"
],
"modifiers": "static",
"parameters": "(JCas jCas)",
"return": "boolean",
"signature": "boolean extractReferencesNaively(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_33 | {
"fields": [],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BioLemmatizerNormalizerAnnotatorTest.java",
"identifier": "BioLemmatizerNormalizerAnnotatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNonTokensIncluded() throws Exception{\n JCas jCas = UimaTests.getTestCas(\"is regulated\");\n\n Measure m = createAnnot(jCas, Measure.class, 0, 1);\n Keep k = createAnnot(jCas, Keep.class, 0, 1);\n k.setEnclosedAnnot(m);\n k.setNormalizedText(\"is\");\n \n Token t = createAnnot(jCas,Token.class, 3, 11);\n createAnnot(jCas, Keep.class, 3, 11).setEnclosedAnnot(t);\n\n PipelineBuilder builder = new JcasPipelineBuilder(jCas);\n builder.add(BlueBioLemmatizer.class);\n builder.add(BioLemmatizerNormalizerAnnotator.class);\n builder.process();\n\n Collection<Keep> keeps = select(jCas, Keep.class);\n assertEquals(2, keeps.size());\n Iterator<Keep> it = keeps.iterator();\n assertEquals(\"i\", it.next().getNormalizedText());\n assertEquals(\"regulate\", it.next().getNormalizedText());\n }",
"class_method_signature": "BioLemmatizerNormalizerAnnotatorTest.testNonTokensIncluded()",
"constructor": false,
"full_signature": "@Test public void testNonTokensIncluded()",
"identifier": "testNonTokensIncluded",
"invocations": [
"getTestCas",
"createAnnot",
"createAnnot",
"setEnclosedAnnot",
"setNormalizedText",
"createAnnot",
"setEnclosedAnnot",
"createAnnot",
"add",
"add",
"process",
"select",
"assertEquals",
"size",
"iterator",
"assertEquals",
"getNormalizedText",
"next",
"assertEquals",
"getNormalizedText",
"next"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testNonTokensIncluded()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "caseSensitive",
"modifier": "@ConfigurationParameter(name = PARAM_CASE_SENSITIVE, defaultValue = \"false\",//\n description = \"If true, tokens are not normalized to lowercase before string comparisions\")\n private",
"original_string": "@ConfigurationParameter(name = PARAM_CASE_SENSITIVE, defaultValue = \"false\",//\n description = \"If true, tokens are not normalized to lowercase before string comparisions\")\n private boolean caseSensitive;",
"type": "boolean",
"var_name": "caseSensitive"
},
{
"declarator": "onlyTokens",
"modifier": "@ConfigurationParameter(name = \"onlyTokens\", defaultValue = \"false\",//\n description = \"Only lemmatize the Keeps that are Tokens, rest are left unchanged.\")\n private",
"original_string": "@ConfigurationParameter(name = \"onlyTokens\", defaultValue = \"false\",//\n description = \"Only lemmatize the Keeps that are Tokens, rest are left unchanged.\")\n private boolean onlyTokens;",
"type": "boolean",
"var_name": "onlyTokens"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/BioLemmatizerNormalizerAnnotator.java",
"identifier": "BioLemmatizerNormalizerAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "BioLemmatizerNormalizerAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "BioLemmatizerNormalizerAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n for (Keep k : select(jCas, Keep.class)) {\n\n Annotation a = k.getEnclosedAnnot(); \n String normalized = null;\n \n // sometimes, Tokens already have a lemma form, use this one.\n if (a instanceof Token) {\n normalized = ((Token) a).getLemmaStr();\n if (!caseSensitive){\n \tnormalized = normalized.toLowerCase();\n }\n k.setNormalizedText(normalized);\n }\n else if(!onlyTokens) {\n\t // Biolemmatizer\n\t try {\n\t \tnormalized = BlueBioLemmatizer.lemmatize(a.getCoveredText(), \"\"); \n\t } catch (Exception e) {\n\t \tLOG.warn(\"Failed to lemmatize '{}'\", a.getCoveredText());\n\t normalized = a.getCoveredText().trim();\n\t }\n\t finally{\n\t if (!caseSensitive){\n\t \tnormalized = normalized.toLowerCase();\n\t }\n\t \n\t k.setNormalizedText(normalized);\n }\n } \n }\n }",
"class_method_signature": "BioLemmatizerNormalizerAnnotator.process(JCas jCas)",
"constructor": false,
"full_signature": "@Override public void process(JCas jCas)",
"identifier": "process",
"invocations": [
"select",
"getEnclosedAnnot",
"getLemmaStr",
"toLowerCase",
"setNormalizedText",
"lemmatize",
"getCoveredText",
"warn",
"getCoveredText",
"trim",
"getCoveredText",
"toLowerCase",
"setNormalizedText"
],
"modifiers": "@Override public",
"parameters": "(JCas jCas)",
"return": "void",
"signature": "void process(JCas jCas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_125 | {
"fields": [],
"file": "utils/blue_commons/src/test/java/ch/epfl/bbp/MapUtilsTest.java",
"identifier": "MapUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testKeyOfHighestValues() {\n\n Map<String, Double> mapp = new HashMap<String, Double>();\n mapp.put(\"s3.5\", 3.5);\n mapp.put(\"s1.5\", 1.5);\n mapp.put(\"s0.5\", 0.5);\n mapp.put(\"s0.6\", 0.6);\n mapp.put(\"2s3.5\", 3.5);\n mapp.put(\"s2.6\", 2.6);\n\n LinkedHashMap<String, Double> m = MapUtils.keysOfHighestValues(mapp, 3);\n\n Iterator<String> it = m.keySet().iterator();\n\n assertEquals(3, m.size());\n assertTrue(it.next().endsWith(\"s3.5\"));\n assertTrue(it.next().endsWith(\"s3.5\"));\n assertEquals(\"s2.6\", it.next());\n\n // exception cases\n LinkedHashMap<String, Double> m2 = keysOfHighestValues(mapp, 0);\n assertEquals(0, m2.size());\n LinkedHashMap<String, Double> m3 = keysOfHighestValues(mapp, 100);\n assertEquals(m3.size(), mapp.size());\n\n }",
"class_method_signature": "MapUtilsTest.testKeyOfHighestValues()",
"constructor": false,
"full_signature": "@Test public void testKeyOfHighestValues()",
"identifier": "testKeyOfHighestValues",
"invocations": [
"put",
"put",
"put",
"put",
"put",
"put",
"keysOfHighestValues",
"iterator",
"keySet",
"assertEquals",
"size",
"assertTrue",
"endsWith",
"next",
"assertTrue",
"endsWith",
"next",
"assertEquals",
"next",
"keysOfHighestValues",
"assertEquals",
"size",
"keysOfHighestValues",
"assertEquals",
"size",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testKeyOfHighestValues()",
"testcase": true
} | {
"fields": [],
"file": "utils/blue_commons/src/main/java/ch/epfl/bbp/MapUtils.java",
"identifier": "MapUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MapUtils.keyOfHighestValue(Map<K, V> map)",
"constructor": false,
"full_signature": "public static K keyOfHighestValue(Map<K, V> map)",
"identifier": "keyOfHighestValue",
"modifiers": "public static",
"parameters": "(Map<K, V> map)",
"return": "K",
"signature": "K keyOfHighestValue(Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"testcase": false
},
{
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"identifier": "keysOfHighestValues",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN, final boolean reverse)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN, final boolean reverse)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map)",
"testcase": false
},
{
"class_method_signature": "MapUtils.sortByValue(\n Map<K, V> map, final boolean reverse)",
"constructor": false,
"full_signature": "public static Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"identifier": "sortByValue",
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, final boolean reverse)",
"return": "Map<K, V>",
"signature": "Map<K, V> sortByValue(\n Map<K, V> map, final boolean reverse)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <K, V extends Comparable<V>> LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN) {\n return keysOfHighestValues(map, topN, true);\n }",
"class_method_signature": "MapUtils.keysOfHighestValues(\n Map<K, V> map, int topN)",
"constructor": false,
"full_signature": "public static LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"identifier": "keysOfHighestValues",
"invocations": [
"keysOfHighestValues"
],
"modifiers": "public static",
"parameters": "(\n Map<K, V> map, int topN)",
"return": "LinkedHashMap<K, V>",
"signature": "LinkedHashMap<K, V> keysOfHighestValues(\n Map<K, V> map, int topN)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_64 | {
"fields": [],
"file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/word2vec/Word2VecUtilsTest.java",
"identifier": "Word2VecUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n assertNotNull(Word2VecUtils.getWordVector(\"brain\"));\n assertNotNull(Word2VecUtils.getWordVector(\"thalamic\"));\n\n }",
"class_method_signature": "Word2VecUtilsTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"assertNotNull",
"getWordVector",
"assertNotNull",
"getWordVector"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOG = getLogger(Word2VecUtils.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(Word2VecUtils.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "MODEL_FILE = \"/Users/richarde/data_hdd/word2vec_models/vectors.bin\"",
"modifier": "static final",
"original_string": "static final String MODEL_FILE = \"/Users/richarde/data_hdd/word2vec_models/vectors.bin\";",
"type": "String",
"var_name": "MODEL_FILE"
},
{
"declarator": "w2v = new Word2Vec()",
"modifier": "private static",
"original_string": "private static Word2Vec w2v = new Word2Vec();",
"type": "Word2Vec",
"var_name": "w2v"
},
{
"declarator": "MODEL_FILE_CLASS = \"/Volumes/HDD2/ren_data/dev_hdd/bluebrain/9_lda/50_word2vec/word2vec_trunk/1m_ns.w2v.100classes.bin\"",
"modifier": "final static",
"original_string": "final static String MODEL_FILE_CLASS = \"/Volumes/HDD2/ren_data/dev_hdd/bluebrain/9_lda/50_word2vec/word2vec_trunk/1m_ns.w2v.100classes.bin\";",
"type": "String",
"var_name": "MODEL_FILE_CLASS"
},
{
"declarator": "w2c = null",
"modifier": "private static",
"original_string": "private static HashMap<String, Integer> w2c = null;",
"type": "HashMap<String, Integer>",
"var_name": "w2c"
}
],
"file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/word2vec/Word2VecUtils.java",
"identifier": "Word2VecUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "Word2VecUtils.Word2VecUtils()",
"constructor": true,
"full_signature": "private Word2VecUtils()",
"identifier": "Word2VecUtils",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " Word2VecUtils()",
"testcase": false
},
{
"class_method_signature": "Word2VecUtils.getWordVector(String word)",
"constructor": false,
"full_signature": "public static float[] getWordVector(String word)",
"identifier": "getWordVector",
"modifiers": "public static",
"parameters": "(String word)",
"return": "float[]",
"signature": "float[] getWordVector(String word)",
"testcase": false
},
{
"class_method_signature": "Word2VecUtils.getClass(String word)",
"constructor": false,
"full_signature": "public static int getClass(String word)",
"identifier": "getClass",
"modifiers": "public static",
"parameters": "(String word)",
"return": "int",
"signature": "int getClass(String word)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static float[] getWordVector(String word) {\n return w2v.getWordVector(word.toLowerCase());\n }",
"class_method_signature": "Word2VecUtils.getWordVector(String word)",
"constructor": false,
"full_signature": "public static float[] getWordVector(String word)",
"identifier": "getWordVector",
"invocations": [
"getWordVector",
"toLowerCase"
],
"modifiers": "public static",
"parameters": "(String word)",
"return": "float[]",
"signature": "float[] getWordVector(String word)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_80 | {
"fields": [
{
"declarator": "LOG = getLogger(LexicaHelperTest.class)",
"modifier": "private static",
"original_string": "private static Logger LOG = getLogger(LexicaHelperTest.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "modules/bluima_lexica/src/test/java/ch/epfl/bbp/uima/LexicaHelperTest.java",
"identifier": "LexicaHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testBrainregions() throws Exception {\n\n String[] brs = { \"bams2004\", \"bams2013\", \"dong\", \"hof\", \"paxinos\",\n \"swanson\", \"neuronames\" };\n for (String br : brs) {\n\n JCas jCas = getTokenizedTestCas(\"with claustrum and\");\n runPipeline(\n jCas,\n LexicaHelper.getConceptMapper(\"brainregions/\" + br),\n createEngineDescription(\n DeduplicatorAnnotator.class,\n PARAM_ANNOTATION_CLASSES,\n new String[] { \"ch.epfl.bbp.uima.types.BrainRegionDictTerm\" }));\n Collection<BrainRegionDictTerm> b = select(jCas,\n BrainRegionDictTerm.class);\n LOG.debug(To.string(b));\n assertEquals(\"no brain matched with \" + br, 1, b.size());\n }\n }",
"class_method_signature": "LexicaHelperTest.testBrainregions()",
"constructor": false,
"full_signature": "@Test public void testBrainregions()",
"identifier": "testBrainregions",
"invocations": [
"getTokenizedTestCas",
"runPipeline",
"getConceptMapper",
"createEngineDescription",
"select",
"debug",
"string",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBrainregions()",
"testcase": true
} | {
"fields": [
{
"declarator": "LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\"",
"modifier": "public final static",
"original_string": "public final static String LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\";",
"type": "String",
"var_name": "LEXICA_ROOT"
},
{
"declarator": "tokenDescrPath = null",
"modifier": "private static",
"original_string": "private static File tokenDescrPath = null;",
"type": "File",
"var_name": "tokenDescrPath"
}
],
"file": "modules/bluima_lexica/src/main/java/ch/epfl/bbp/uima/LexicaHelper.java",
"identifier": "LexicaHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "LexicaHelper.getTokenDescPath(AnalysisEngineDescription tokenDesc)",
"constructor": false,
"full_signature": "private static String getTokenDescPath(AnalysisEngineDescription tokenDesc)",
"identifier": "getTokenDescPath",
"modifiers": "private static",
"parameters": "(AnalysisEngineDescription tokenDesc)",
"return": "String",
"signature": "String getTokenDescPath(AnalysisEngineDescription tokenDesc)",
"testcase": false
},
{
"class_method_signature": "LexicaHelper.getConceptMapper(String path,\n String[] args)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static AnalysisEngineDescription getConceptMapper(String path,\n String[] args)",
"identifier": "getConceptMapper",
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(String path,\n String[] args)",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getConceptMapper(String path,\n String[] args)",
"testcase": false
},
{
"class_method_signature": "LexicaHelper.getConceptMapper(String path)",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getConceptMapper(String path)",
"identifier": "getConceptMapper",
"modifiers": "public static",
"parameters": "(String path)",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getConceptMapper(String path)",
"testcase": false
},
{
"class_method_signature": "LexicaHelper.getConceptMapper(String path,\n AnalysisEngineDescription tokenDesc)",
"constructor": false,
"full_signature": "public static AnalysisEngineDescription getConceptMapper(String path,\n AnalysisEngineDescription tokenDesc)",
"identifier": "getConceptMapper",
"modifiers": "public static",
"parameters": "(String path,\n AnalysisEngineDescription tokenDesc)",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getConceptMapper(String path,\n AnalysisEngineDescription tokenDesc)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@SuppressWarnings(\"unchecked\")\n public static AnalysisEngineDescription getConceptMapper(String path,\n String[] args) throws UIMAException, IOException, SAXException {\n\n String conceptMapper = LEXICA_ROOT + \"desc/\" + path\n + \"ConceptMapper.xml\";\n if (!new File(conceptMapper).exists()) {\n\n String fileList = \"\";\n for (File f : newArrayList(iterateFiles(new File(LEXICA_ROOT\n + \"desc\"), new String[] { \"\" }, true))) {\n fileList += f.getPath() + \" \";\n }\n\n throw new FileNotFoundException(\"no ConceptMapper file at \"\n + conceptMapper + \", available: \" + fileList);\n }\n\n String lexicon = LEXICA_ROOT + \"resources/\" + path + \".xml\";\n checkArgument(new File(lexicon).exists(), \"no lexicon file at \"\n + lexicon);\n\n @SuppressWarnings(\"rawtypes\")\n List argsArray;\n if (args == null) {\n argsArray = newArrayList(\"TokenizerDescriptorPath\",\n getTokenDescPath(OpenNlpHelper.getTokenizer()), \"Stemmer\",\n SCharsStemmer.class.getName());\n } else {\n argsArray = Lists.newArrayList(args);\n argsArray.add(\"TokenizerDescriptorPath\");\n argsArray.add(getTokenDescPath(OpenNlpHelper.getTokenizer()));\n }\n\n AnalysisEngineDescription aed = (AnalysisEngineDescription) createResourceCreationSpecifier(\n conceptMapper, argsArray.toArray());\n\n // Create the external resource dependency for the model and bind it\n ExternalResourceFactory.createDependencyAndBind(aed, \"DictionaryFile\",\n DictionaryResource_impl.class, \"file:\" + lexicon);\n return aed;\n }",
"class_method_signature": "LexicaHelper.getConceptMapper(String path,\n String[] args)",
"constructor": false,
"full_signature": "@SuppressWarnings(\"unchecked\") public static AnalysisEngineDescription getConceptMapper(String path,\n String[] args)",
"identifier": "getConceptMapper",
"invocations": [
"exists",
"newArrayList",
"iterateFiles",
"getPath",
"checkArgument",
"exists",
"newArrayList",
"getTokenDescPath",
"getTokenizer",
"getName",
"newArrayList",
"add",
"add",
"getTokenDescPath",
"getTokenizer",
"createResourceCreationSpecifier",
"toArray",
"createDependencyAndBind"
],
"modifiers": "@SuppressWarnings(\"unchecked\") public static",
"parameters": "(String path,\n String[] args)",
"return": "AnalysisEngineDescription",
"signature": "AnalysisEngineDescription getConceptMapper(String path,\n String[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
23831132_38 | {
"fields": [],
"file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/LinnaeusAnnotatorTest.java",
"identifier": "LinnaeusAnnotatorTest",
"interfaces": "",
"superclass": "extends TestWithBluimaResource"
} | {
"body": "@Test\n public void test() throws Exception {\n String file = \"/linnaeus/pmcA1239921.txt\";\n InputStream stream = getClass().getResourceAsStream(file);\n String testtext = IOUtils.toString(stream);\n\n JCas jCas = getTestCas(testtext);\n\n createLinnaeusEngine().process(jCas);\n\n Collection<LinnaeusSpecies> sps = select(jCas, LinnaeusSpecies.class);\n\n assertResultsContains(sps, \"mostProbableSpeciesId\", \"species:ncbi:9606\");\n assertResultsContains(sps, \"mostProbableSpeciesId\", \"species:ncbi:9913\");\n }",
"class_method_signature": "LinnaeusAnnotatorTest.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"getResourceAsStream",
"getClass",
"toString",
"getTestCas",
"process",
"createLinnaeusEngine",
"select",
"assertResultsContains",
"assertResultsContains"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "matcher",
"modifier": "private",
"original_string": "private Matcher matcher;",
"type": "Matcher",
"var_name": "matcher"
},
{
"declarator": "logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)",
"modifier": "private",
"original_string": "private Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "configFile",
"modifier": "@ConfigurationParameter(name = PARAM_CONFIG_FILE, mandatory = true)\n private",
"original_string": "@ConfigurationParameter(name = PARAM_CONFIG_FILE, mandatory = true)\n private String configFile;",
"type": "String",
"var_name": "configFile"
}
],
"file": "modules/bluima_commons/src/main/java/ch/epfl/bbp/uima/ae/LinnaeusAnnotator.java",
"identifier": "LinnaeusAnnotator",
"interfaces": "",
"methods": [
{
"class_method_signature": "LinnaeusAnnotator.initialize(UimaContext context)",
"constructor": false,
"full_signature": "@Override public void initialize(UimaContext context)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(UimaContext context)",
"return": "void",
"signature": "void initialize(UimaContext context)",
"testcase": false
},
{
"class_method_signature": "LinnaeusAnnotator.process(JCas cas)",
"constructor": false,
"full_signature": "@Override public void process(JCas cas)",
"identifier": "process",
"modifiers": "@Override public",
"parameters": "(JCas cas)",
"return": "void",
"signature": "void process(JCas cas)",
"testcase": false
},
{
"class_method_signature": "LinnaeusAnnotator.collectionProcessComplete()",
"constructor": false,
"full_signature": "@Override public void collectionProcessComplete()",
"identifier": "collectionProcessComplete",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void collectionProcessComplete()",
"testcase": false
}
],
"superclass": "extends JCasAnnotator_ImplBase"
} | {
"body": "@Override\n public void process(JCas cas) throws AnalysisEngineProcessException {\n\n String text = cas.getDocumentText();\n List<Mention> mentions = matcher.match(text);\n for (Mention mention : mentions) {\n\n String mostProbableID = mention.getMostProbableID();\n String idsToString = mention.getIdsToString();\n\n LinnaeusSpecies species = new LinnaeusSpecies(cas);\n species.setBegin(mention.getStart());\n species.setEnd(mention.getEnd());\n species.setMostProbableSpeciesId(mostProbableID);\n species.setAllIdsString(idsToString);\n species.setAmbigous(mention.isAmbigous());\n species.addToIndexes();\n }\n }",
"class_method_signature": "LinnaeusAnnotator.process(JCas cas)",
"constructor": false,
"full_signature": "@Override public void process(JCas cas)",
"identifier": "process",
"invocations": [
"getDocumentText",
"match",
"getMostProbableID",
"getIdsToString",
"setBegin",
"getStart",
"setEnd",
"getEnd",
"setMostProbableSpeciesId",
"setAllIdsString",
"setAmbigous",
"isAmbigous",
"addToIndexes"
],
"modifiers": "@Override public",
"parameters": "(JCas cas)",
"return": "void",
"signature": "void process(JCas cas)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 11,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 23831132,
"size": 220469,
"stargazer_count": 21,
"stars": null,
"updates": null,
"url": "https://github.com/BlueBrain/bluima"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.