forked from siel-iiith/nirbhaya
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77b84e3
commit 5b63b24
Showing
9 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
javac -d bin -sourcepath src -cp lib/saplo4java-3.0.0.jar src/com/solutions/*.java |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.solutions; | ||
|
||
class Department | ||
{ | ||
String dept_name, Address, RTI_Info, location; | ||
long departmentid; | ||
public enum department {CENTRAL, STATE, NGO}; | ||
department dept_type; | ||
public void setDeptName(String names) | ||
{ | ||
this.dept_name = names; | ||
} | ||
public void setDepartmentId(long deptid) | ||
{ | ||
this.departmentid = deptid; | ||
} | ||
public void setAddress(String addr) | ||
{ | ||
this.Address = addr; | ||
} | ||
public void setLocation(String loc) | ||
{ | ||
this.location = loc; | ||
} | ||
public void setRTIInfo(String rti) | ||
{ | ||
this.RTI_Info = rti; | ||
} | ||
public void setDepartmentType(department dept) | ||
{ | ||
this.dept_type = dept; | ||
} | ||
public String getDeptName() | ||
{ | ||
return dept_name; | ||
} | ||
public long getDepartmentId() | ||
{ | ||
return departmentid; | ||
} | ||
public String getAddress() | ||
{ | ||
return Address; | ||
} | ||
public String getLocation() | ||
{ | ||
return location; | ||
} | ||
public String getRTIInfo() | ||
{ | ||
return RTI_Info; | ||
} | ||
public department getDepartmentType() | ||
{ | ||
return dept_type; | ||
} | ||
|
||
public static void main(String[] args) | ||
{ | ||
Department D = new Department(); | ||
D.setDeptName("electrical"); | ||
System.out.println(D.getDeptName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.solutions; | ||
|
||
class Person | ||
{ | ||
String name,designation,emailid,phone; | ||
long departmentid; | ||
public void setName(String names) | ||
{ | ||
this.name = names; | ||
} | ||
public void setDesignation(String desig) | ||
{ | ||
this.designation = desig; | ||
} | ||
public void setPhone(String phonenum) | ||
{ | ||
this.phone = phonenum; | ||
} | ||
public void setEmail(String email) | ||
{ | ||
this.emailid = email; | ||
} | ||
public void setDepartmentId(long deptid) | ||
{ | ||
this.departmentid = deptid; | ||
} | ||
public String getName() | ||
{ | ||
return name; | ||
} | ||
public String getDesignation() | ||
{ | ||
return designation; | ||
} | ||
public String getPhone() | ||
{ | ||
return phone; | ||
} | ||
public String getEmail() | ||
{ | ||
return emailid; | ||
} | ||
public long getDepartmentId() | ||
{ | ||
return departmentid; | ||
} | ||
|
||
|
||
public static void main(String[] args) | ||
{ | ||
// Person p = new Person("aditya","eng",12121,"0800181","[email protected]"); | ||
Person p = new Person(); | ||
p.setName("aditya"); | ||
p.setDesignation("eng"); | ||
p.setDepartmentId(12121); | ||
p.setEmail("[email protected]"); | ||
p.setPhone("132131"); | ||
System.out.println(p.getEmail()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.solutions; | ||
import com.saplo.api.client.SaploClient; | ||
import com.saplo.api.client.entity.SaploCollection; | ||
import com.saplo.api.client.entity.SaploCollection.Language; | ||
import com.saplo.api.client.entity.SaploTag; | ||
import com.saplo.api.client.entity.SaploText; | ||
import com.saplo.api.client.manager.SaploCollectionManager; | ||
import com.saplo.api.client.manager.SaploTextManager; | ||
|
||
public class TestingWithSaploAPI { | ||
public static void main(String args[]) throws Exception | ||
{ | ||
SaploClient client = new SaploClient("a69ef0eb267e3578963a465b2b871208", "e88b050934321f88acb257fda2e892e2"); | ||
// Your access_token is stored in the client. | ||
// If you want to retrieve it, you can | ||
String accessToken = client.getAccessToken(); | ||
System.out.println(accessToken); | ||
|
||
// First you need to create a manager to work with collections | ||
SaploCollectionManager collectionMgr = new SaploCollectionManager(client); | ||
|
||
// Then create a collection object | ||
SaploCollection collection = new SaploCollection("My Collection Name", Language.en); | ||
|
||
// Save the created collection in the API using the manager | ||
collectionMgr.create(collection); | ||
|
||
// First create a manager to work with text | ||
SaploTextManager textMgr = new SaploTextManager(client); | ||
|
||
// Then create a text object in your collection | ||
SaploText text = new SaploText(collection, "Some cool text about Apple - the company, goes here"); | ||
text.setHeadline("Some cool headline"); | ||
text.setAuthors("Me"); | ||
|
||
// Then save your text using the manager | ||
textMgr.create(text); | ||
|
||
// Get a list of tags that exist in your text | ||
java.util.List<SaploTag> tags = textMgr.tags(text); | ||
|
||
// Print them out | ||
for(SaploTag tag: tags) | ||
System.out.println("Category: " + tag.getCategory() | ||
+ " TagWord: " + tag.getTagWord()); | ||
} | ||
} |