id
stringlengths
36
36
text
stringlengths
1
1.25M
cc80e312-9a55-41c5-9cd2-f741ad204b45
public boolean hasNext() { if (temp) { temp = false; return true; } else { return false; } }
76131ca5-0308-4aa5-960a-83819bea5f3a
public void getNext(CAS aCAS) throws IOException, CollectionException { JCas jcas; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new CollectionException(e); } Scanner reader = new Scanner(file); String content = null; // Scan file into content. while (reader.h...
eb4b01d3-3ad6-4982-a623-d7b77717c1e7
@Override public void close() throws IOException { // TODO Auto-generated method stub }
68f602cf-2700-40ef-8f05-d430e6e6c338
@Override public Progress[] getProgress() { // TODO Auto-generated method stub return null; }
ad84e9a8-9e50-4f4b-b21e-6006d3420089
@Override public void initialize() { try { out = new File("src/main/resources/data/hw1-huatang.out");// Path to create my output file. bw = new BufferedWriter(new FileWriter(out)); } catch (Exception e) { e.printStackTrace(); } testfile = new File("src/main/resources/data/sample.ou...
2a8d217d-9f7b-4873-8f55-f3d5931e0cb8
@Override public void processCas(CAS aCas) throws ResourceProcessException { // TODO Auto-generated method stub JCas jcas; try { jcas = aCas.getJCas(); } catch (CASException e) { throw new ResourceProcessException(e); } FSIterator<org.apache.uima.jcas.tcas.Annotation> it = jcas.ge...
5c66bcbc-32fd-4af4-8162-3e2eee5d87f1
public void writeIntoFile(String geneId, String geneContent, int begin, int end) throws Exception { bw.write(geneId + "|" + begin + " " + end + "|" + geneContent); bw.newLine(); bw.flush(); }
cf06bc2b-e0bf-4c93-80f7-344931f6964e
public void initialize(UimaContext context) { modelFile = new File("src/main/resources/ne-en-bio-genetag.HmmChunker"); // From Lingpipe try { chunker = (ConfidenceChunker) AbstractExternalizable.readObject(modelFile); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block ...
d04b38a9-5374-4923-b9c0-4080e27ff307
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { // TODO Auto-generated method stub JCas jcas = aJCas; try { chunker = (ConfidenceChunker) AbstractExternalizable.readObject(modelFile); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (I...
e06d1901-cc10-474b-9569-b24da2c8166c
private int countWhiteSpaces(String phrase) { int countBlank = 0; for (int i = 0; i < phrase.length(); i++) { if (Character.isWhitespace(phrase.charAt(i))) { countBlank++; } } return countBlank; }
65401ead-e424-4b23-8894-2b498816b3ec
@Override public int getTypeIndexID() {return typeIndexID;}
ee3bf4f5-2c06-403b-91a4-5ced8b064e59
protected sentenceTag() {/* intentionally empty block */}
15801bb9-3ee9-4e23-8be0-70dc53e3554f
public sentenceTag(int addr, TOP_Type type) { super(addr, type); readObject(); }
7fb30bd4-f7c2-4d37-a4f1-39fa8ea5980b
public sentenceTag(JCas jcas) { super(jcas); readObject(); }
4b87104d-343e-40d1-b382-65c9ac88ad28
public sentenceTag(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
c173e2ff-8a7a-41a3-a0db-54f8a722e866
private void readObject() {/*default - does nothing empty block */}
804dc70c-2f5d-4715-9cc4-5cfc50bd33aa
public String getId() { if (sentenceTag_Type.featOkTst && ((sentenceTag_Type)jcasType).casFeat_id == null) jcasType.jcas.throwFeatMissing("id", "sentenceTag"); return jcasType.ll_cas.ll_getStringValue(addr, ((sentenceTag_Type)jcasType).casFeatCode_id);}
f06a8bc0-74cd-4ae3-b10c-047b3724e36f
public void setId(String v) { if (sentenceTag_Type.featOkTst && ((sentenceTag_Type)jcasType).casFeat_id == null) jcasType.jcas.throwFeatMissing("id", "sentenceTag"); jcasType.ll_cas.ll_setStringValue(addr, ((sentenceTag_Type)jcasType).casFeatCode_id, v);}
1707b15b-1921-4704-bd3f-ee52ea09d9ba
public String getContent() { if (sentenceTag_Type.featOkTst && ((sentenceTag_Type)jcasType).casFeat_content == null) jcasType.jcas.throwFeatMissing("content", "sentenceTag"); return jcasType.ll_cas.ll_getStringValue(addr, ((sentenceTag_Type)jcasType).casFeatCode_content);}
e1cae52a-3835-48d9-b626-df0f5d0b28cf
public void setContent(String v) { if (sentenceTag_Type.featOkTst && ((sentenceTag_Type)jcasType).casFeat_content == null) jcasType.jcas.throwFeatMissing("content", "sentenceTag"); jcasType.ll_cas.ll_setStringValue(addr, ((sentenceTag_Type)jcasType).casFeatCode_content, v);}
01ccd838-b3d0-4d33-acae-57d4ca9ba168
@Override public int getTypeIndexID() {return typeIndexID;}
30262b11-67ca-4d72-92e8-a35e684db085
protected geneTag() {/* intentionally empty block */}
bc699d2f-836a-4bdd-8a98-b2cfa52269f1
public geneTag(int addr, TOP_Type type) { super(addr, type); readObject(); }
f87d0539-7040-4164-90d6-2fdb2e8282ec
public geneTag(JCas jcas) { super(jcas); readObject(); }
bc90f2ac-c140-4cdd-86d7-c0d2a066b343
public geneTag(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
b5075a31-be3a-4ade-a82c-8919dc1377b6
private void readObject() {/*default - does nothing empty block */}
3d130df0-c2d4-4560-a578-51126a27ed64
public String getId() { if (geneTag_Type.featOkTst && ((geneTag_Type)jcasType).casFeat_id == null) jcasType.jcas.throwFeatMissing("id", "geneTag"); return jcasType.ll_cas.ll_getStringValue(addr, ((geneTag_Type)jcasType).casFeatCode_id);}
12b10988-f2c9-43cb-9cc5-c5a508ce6c6b
public void setId(String v) { if (geneTag_Type.featOkTst && ((geneTag_Type)jcasType).casFeat_id == null) jcasType.jcas.throwFeatMissing("id", "geneTag"); jcasType.ll_cas.ll_setStringValue(addr, ((geneTag_Type)jcasType).casFeatCode_id, v);}
88b37add-5a15-473d-9c55-5bf78606c796
public String getContent() { if (geneTag_Type.featOkTst && ((geneTag_Type)jcasType).casFeat_content == null) jcasType.jcas.throwFeatMissing("content", "geneTag"); return jcasType.ll_cas.ll_getStringValue(addr, ((geneTag_Type)jcasType).casFeatCode_content);}
d4f515ee-0dc4-4505-bb2d-cf17f86bf841
public void setContent(String v) { if (geneTag_Type.featOkTst && ((geneTag_Type)jcasType).casFeat_content == null) jcasType.jcas.throwFeatMissing("content", "geneTag"); jcasType.ll_cas.ll_setStringValue(addr, ((geneTag_Type)jcasType).casFeatCode_content, v);}
ad5515d3-2e78-40be-9f92-db31cf649a70
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { // TODO Auto-generated method stub String content = aJCas.getDocumentText(); String[] sentence = content.split("\n"); // Split every sentence by 'enter' for (int i = 0; i < sentence.length; i++) { int partition = s...
ae910b2f-cf13-42eb-99f6-827a39c30f05
public PosTagNamedEntityRecognizer() throws ResourceInitializationException { Properties props = new Properties(); props.put("annotators", "tokenize, ssplit, pos"); pipeline = new StanfordCoreNLP(props); }
9995e285-0f81-450a-a91f-bdc85ad5c496
public Map<Integer, Integer> getGeneSpans(String text) { Map<Integer, Integer> begin2end = new HashMap<Integer, Integer>(); Annotation document = new Annotation(text); pipeline.annotate(document); List<CoreMap> sentences = document.get(SentencesAnnotation.class); for (CoreMap sentence : sentences) {...
b39eb418-a88b-407f-925d-10baf0b0975e
@Override protected FSGenerator getFSGenerator() {return fsGenerator;}
66bb0033-c88e-44cd-acfd-2efb333afa14
public FeatureStructure createFS(int addr, CASImpl cas) { if (sentenceTag_Type.this.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = sentenceTag_Type.this.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new sentenceTag(addr, sentenceT...
a13d7497-c9c0-45bc-819a-64c91decbe29
public String getId(int addr) { if (featOkTst && casFeat_id == null) jcas.throwFeatMissing("id", "sentenceTag"); return ll_cas.ll_getStringValue(addr, casFeatCode_id); }
c8ceb2e6-54ca-4b7d-a1c2-6c393fb542fb
public void setId(int addr, String v) { if (featOkTst && casFeat_id == null) jcas.throwFeatMissing("id", "sentenceTag"); ll_cas.ll_setStringValue(addr, casFeatCode_id, v);}
8ba5de53-4e33-47e2-a94e-3f2a7eeae0f2
public String getContent(int addr) { if (featOkTst && casFeat_content == null) jcas.throwFeatMissing("content", "sentenceTag"); return ll_cas.ll_getStringValue(addr, casFeatCode_content); }
a1d65ef5-2a66-4f04-b411-5e9a6b2319d3
public void setContent(int addr, String v) { if (featOkTst && casFeat_content == null) jcas.throwFeatMissing("content", "sentenceTag"); ll_cas.ll_setStringValue(addr, casFeatCode_content, v);}
01744ac9-4438-4d4e-ba9e-aa34b1163a86
public sentenceTag_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); casFeat_id = jcas.getRequiredFeatureDE(casType, "id", "uima.cas.String", featOkTst); casFeatCode_id = (null == casFeat_id) ? JCas.INVAL...
e99b1d2e-9c3c-4e3f-8157-63563e52812a
@Override protected FSGenerator getFSGenerator() {return fsGenerator;}
d52d102b-2866-4e3e-9df6-056560ed720f
public FeatureStructure createFS(int addr, CASImpl cas) { if (geneTag_Type.this.useExistingInstance) { // Return eq fs instance if already created FeatureStructure fs = geneTag_Type.this.jcas.getJfsFromCaddr(addr); if (null == fs) { fs = new geneTag(addr, geneTag_Type.this); ...
3bb72dd8-266d-49a4-9fc8-af1200760084
public String getId(int addr) { if (featOkTst && casFeat_id == null) jcas.throwFeatMissing("id", "geneTag"); return ll_cas.ll_getStringValue(addr, casFeatCode_id); }
e4cf487d-59ac-44d1-87a5-29aba566ec32
public void setId(int addr, String v) { if (featOkTst && casFeat_id == null) jcas.throwFeatMissing("id", "geneTag"); ll_cas.ll_setStringValue(addr, casFeatCode_id, v);}
8f147c51-bbd6-48e9-9091-8f90c88fcc75
public String getContent(int addr) { if (featOkTst && casFeat_content == null) jcas.throwFeatMissing("content", "geneTag"); return ll_cas.ll_getStringValue(addr, casFeatCode_content); }
d33e0919-98be-4dc0-8071-428a6c9515b3
public void setContent(int addr, String v) { if (featOkTst && casFeat_content == null) jcas.throwFeatMissing("content", "geneTag"); ll_cas.ll_setStringValue(addr, casFeatCode_content, v);}
e8ee0242-af94-4f54-94f8-0ba9b8af8748
public geneTag_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); casFeat_id = jcas.getRequiredFeatureDE(casType, "id", "uima.cas.String", featOkTst); casFeatCode_id = (null == casFeat_id) ? JCas.INVALID_F...
d59c899c-8199-433a-8c3c-fc10cd9d9920
@BeforeClass public static void init(){ Configuration config=new Configuration().configure(); sessionFactory=config.buildSessionFactory(); }
3acf52d8-6e4e-4e00-a520-f89f43ec01c0
@Test public void testQuery1(){ Session session=null; Transaction tx=null; User user=null; try{ session=sessionFactory.openSession(); tx=session.beginTransaction(); /*Query session.createQuery(String hql)方法; * hibernate的session.createQuery()方法是使用HQL(hibernate的查询语句)语句查询对象的。 * hql:是查询对象的,例如...
676c3c8f-f6aa-4b6a-b974-a13bb65d6311
@BeforeClass public static void init(){ //读取配置hibernate.cfg.xml Configuration config=new Configuration().configure(); sessionFactory=config.buildSessionFactory(); }
73f18f0b-56e6-499c-b942-317345232f0c
@Test public void testSave1() { Session session=null; Transaction tx = null; User user=null; try{ session=sessionFactory.openSession(); tx= session.beginTransaction(); user=new User(); user.setAge(26); user.setName("刘江龙"); user.setCreateTime(new Date()); user.setExpireTime(new Date()); ...
ed8463f8-0ac6-489f-82b6-fe5c9bdc0e0a
@Test public void testGet(){ Session session=null; Transaction tx=null; User user=null; try{ session=sessionFactory.openSession(); tx=session.beginTransaction(); /* * Object org.hibernate.Session.get(Class arg0, Serializable arg1) throws HibernateException * arg0:需要加载对象的类,例如:User.class * ...
511b9b4b-4ced-43a5-a0f3-8fc24c881323
@Test public void testLoad(){ Session session=null; Transaction tx=null; User user=null; try{ session=sessionFactory.openSession(); tx=session.beginTransaction(); /** arg0:需要加载对象的类,例如:User.class * arg1:查询条件(实现了序列化接口的对象):例"4028940447f7bf260147f7bf27aa0000"字符串已经实现 了序列化接口。 * 此方法返回类型为Object,但返回的...
b16a4f0e-2905-4f23-b670-120b9120bb4a
@Test public void testDelete1(){ Session session=null; Transaction tx=null; User user=null; try{ session=sessionFactory.openSession(); tx=session.beginTransaction(); user=(User)session.load(User.class, "4028940447f7bf260147f7bf27aa0000");//根据主键加载对象 logger.debug("load延迟加载user对象,由于暂时没有用到user对象的方法,所以不...
07c10733-3cb8-472f-8176-1a31e081c605
public static void main(String[] args){ /* * org.hibernate.cfg.Configuration类的作用: * 读取hibernate配置文件(hibernate.cfg.xml或hiberante.properties)的. wjt276 Hibernate学习笔记第12页 共 132页 * new Configuration()默认是读取hibernate.properties * 所以使用new Configuration().configure();来读取hibernate.cfg.xml配置文件 */ Configuration cfg = new Configura...
bea3aa28-31ad-4690-937a-99bed19fd113
public static void main(String[] args) { //读取hibernate.cfg.xml文件 Configuration config=new Configuration().configure(); /** * 创建SessionFactory, * 一个数据库对应一个SessionFactory * SessionFactory是线程安全的 */ @SuppressWarnings("unchecked") SessionFactory factory=config.buildSessionFactory(); /** * 创建...
627c183f-0842-49a1-bd4c-2a55a5adf2d2
public String getId() { return id; }
905a49e0-28b2-494e-93de-fdbbbb710250
public void setId(String id) { this.id = id; }
1150280e-1f04-4d68-bcf8-8e7d53bfd38d
public String getName() { return name; }
69468411-f167-46f6-b30c-d723fb5f695b
public void setName(String name) { this.name = name; }
bf5482d4-7d95-4952-a5ca-751a343c8aea
public String getPassword() { return password; }
52205509-7afc-43c9-bea5-89b5f6f21327
public void setPassword(String password) { this.password = password; }
3bac1f66-bc7b-4163-aede-176806dc575c
public Date getCreateTime() { return createTime; }
7659e202-2f84-4dad-a202-4b34227a550c
public void setCreateTime(Date createTime) { this.createTime = createTime; }
a30bd23f-bcf2-45d0-8da8-2cfac9c8eb94
public Date getExpireTime() { return expireTime; }
48f003b8-0ab6-460c-8e33-f90ff0d1246f
public void setExpireTime(Date expireTime) { this.expireTime = expireTime; }
febd8ee4-855a-44c9-a5c2-1c4ca1e7014a
public int getAge() { return age; }
177c1fe4-a6a7-4e21-a7bf-faabdef0883f
public void setAge(int age) { this.age = age; }
59e04ccd-c46b-44dc-83d4-c7874a1fb53b
public KeyUndefinedException(String s){ super(s); }
08afaed0-fdf0-481e-813c-229a001660d5
public EndOfSessionException(String s){ super(s); }
94f4b86e-2323-42aa-9e55-8b4e3d6324ac
public AddUser() { // TODO Auto-generated constructor stub }
84fd8411-91bf-4122-a559-0bfc2e18ed9f
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject user = Users.addUser(request.getParameter("prenom"), request.getParameter("nom"), request.getParameter("login"), request.getParameter("password")); response.getWriter().println(user.toStr...
fcb289ce-ee1f-4792-ad8d-ba70ee985a23
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
a2d94f34-8ee8-4777-8514-6405703b5f27
public RemoveFriend() { // TODO Auto-generated constructor stub }
62118c5e-0f6c-487b-b2ed-97c9c32aa18a
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject json = Users.removeFriend(request.getParameter("key"), request.getParameter("id_friend")); response.getWriter().println(json.toString()); }
08bb978e-c1fe-4b85-a020-1579e06040b4
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
fbdcd1e5-a604-443c-83ef-159ddd3e1d32
public ConnectUser() { // TODO Auto-generated constructor stub }
418186a6-c185-4448-af39-ef290c095fae
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject json = Users.connectUser(request.getParameter("login"), request.getParameter("password")); System.out.println(json.toString()); response.setContentType("application/json"); response.g...
6d172783-d81b-4b13-afca-346c58ddbdd8
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
155b0037-ad53-41c5-bbfa-7afc39ab28d0
public ListSearch() { super(); // TODO Auto-generated constructor stub }
842d5a10-8d8e-4b5f-85bf-c5d62b83c34d
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
e4bb0aaa-572c-487f-9bae-3533814d8c36
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
75eaac46-9fc6-4381-9383-89e03faf212b
private void sendGet() throws Exception { String url = "http://www.google.com/search?q=mkyong"; URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); // optional default is GET con.setRequestMethod("GET"); //add request header con.setRequestProperty("User-Agen...
fa62cfe1-85d4-4462-a2c9-9091a10fee40
public AddComment() { // TODO Auto-generated constructor stub }
74841494-f7d0-4bf4-96f1-e921d2955fe3
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject comment = Comments.addComment(request.getParameter("key"), request.getParameter("text")); response.getWriter().println(comment.toString()); }
78956caf-d1f5-46e5-a9b6-3ab70caae3e3
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
25208e23-55b8-4e18-99a6-60c82af64538
public Logout() { // TODO Auto-generated constructor stub }
2189c0c9-875a-470f-93d1-f3e9c1c22694
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject json = Users.Logout(); //ne pas oublier de la définir dans la classe Users response.getWriter().println(json.toString()); }
595e50ea-0919-4674-ab5a-1d6080ab3577
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
9ef1f92f-fd6f-4cf3-a160-7d8e79510b00
public Search() { // TODO Auto-generated constructor stub }
ff944019-5496-4167-bf0c-d6b357875160
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject comments = Comments.search(request.getParameter("key"), request.getParameter("query"), request.getParameter("friends")); response.getWriter().println(comments.toString()); }
635c53eb-5a2f-4b80-ae68-ea72f6beab2a
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
8fbe4e10-5bad-4715-9802-318fc86aafd0
public AddFriend() { // TODO Auto-generated constructor stub }
2bf63a7a-66ca-4f7b-9cf2-e955b756533d
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject json = Users.addFriend(request.getParameter("key"), request.getParameter("id_friend")); response.getWriter().println(json.toString()); }
95ee3a3b-37df-469d-8fbf-c2a1a8b93e8b
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub }
816bd95c-5eba-46fb-83af-4966bdc951be
public static void main(String[] args) { //crée quelques utilisateurs pour voir ce qui se passe try{ MongoClient client = new MongoClient("192.168.56.101"); DB db = client.getDB( "mydb" ); Set<String> colls = db.getCollectionNames(); for (String s : colls){ System.out.println(s); } ...
00ef4252-93af-44dd-b49b-9928a321fd50
public static JSONObject addUser(String prenom, String nom, String login, String password){ if (prenom == null || nom == null || login == null || password == null) { return Tools.erreur("Parametre manquant");//retourne un objet JSON avec un champ erreur ayant pour valeur "parametre manquant" } else if (BDUse...
1db56685-6e8b-4e3b-99db-53bc2a9f2b04
public static JSONObject connectUser(String login, String password){ if (BDUser.verifLoginPassword(login, password)){ JSONObject json = new JSONObject(); try { json.put ("output" ,"OK" ); } catch ( JSONException e ) { return Tools.erreur(e.getMessage()); } return json; } else return Tool...
68d1298a-e481-49ee-bb59-73a7940d2c2b
public static JSONObject addFriend(String key, String id_friend) { if (key == null || id_friend == null) { return Tools.erreur("Parametre manquant");//retourne un objet JSON avec un champ erreur ayant pour valeur "parametre manquant" } else{ BDUser.addFriend(key, id_friend); JSONObject json = new JSONO...
cb264858-9915-4405-a64b-970f67348149
public static JSONObject removeFriend(String key, String id_friend) { if (key == null || id_friend == null) { return Tools.erreur("Parametre manquant");//retourne un objet JSON avec un champ erreur ayant pour valeur "parametre manquant" } else{ BDUser.removeFriend(key, id_friend); JSONObject json = new...