Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Person rec #126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added src/.metadata/.lock
Empty file.
20 changes: 20 additions & 0 deletions src/.metadata/.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
!SESSION 2015-12-22 02:02:06.583 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.core.net 1 0 2015-12-22 02:03:19.168
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
!SESSION 2015-12-22 14:08:13.312 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/bugrahansahin/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/bugrahansahin/.eclipse_keyring -showlocation

!ENTRY org.eclipse.core.net 1 0 2015-12-22 14:09:01.084
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Binary file added src/.metadata/.mylyn/.taskListIndex/segments.gen
Binary file not shown.
Binary file added src/.metadata/.mylyn/.taskListIndex/segments_1
Binary file not shown.
Binary file added src/.metadata/.mylyn/.tasks.xml.zip
Binary file not shown.
Binary file added src/.metadata/.mylyn/repositories.xml.zip
Binary file not shown.
Binary file added src/.metadata/.mylyn/tasks.xml.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import java.util.*;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
alltags.put(tag, cltag);
}
//N is the number of total users in the system
//tags are the tags of the current person which is p1, p2 is the person to be compared
public static double similarity(String[] tags,int p1,int p2, int N)
{ tagcl curtag;
Set<String> tagset = new TreeSet<String>();
for (int i=0;i<tags.length;i++)
{ tagset.add(tags[i]);
}
String[] tagsar = new String[tagset.size()];
tagsar= tagset.toArray(tagsar);
double res=0;
for (int i=0;i<tagsar.length;i++)
curtag=alltags.get(tagsar[i]);
res+=Math.log(N/curtag.hmpeople())*curtag.logfreq(p1)*curtag.logfreq(p2);
return res;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.util.HashMap;
import java.util.Map;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import java.util.*;

public class tagcl {
String tag;
Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
public int hmpeople()
{ return hashIt.size();
}
public double logfreq(int p)
{ if(!hasIt.containsKey(p))
return -1;
int b;
b=hasIt.get(p);
return 1+Math.log(b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.util.*;

public class tagcl {
String tag;
static Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public static void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
public static double logfreq()
{ if(!hasIt.containsKey(p))
return -1;
int b;
b=hasit.get(p);
return 1+Math.log(b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import java.util.*;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
alltags.put(tag, cltag);
}
//N is the number of total users in the system
//tags are the tags of the current person which is p1, p2 is the person to be compared
public static double similarity(String[] tags,int p1,int p2, int N)
{ tagcl curtag;
Set<String> tagset = new TreeSet<String>();
for (int i=0;i<tags.length;i++)
{ tagset.add(tags[i]);
}
String[] tagsar = new String[tagset.size()];
tagsar= tagset.toArray(tagsar);
double res=0;
for (int i=0;i<tagsar.length;i++)
curtag=alltags.get(tagsar[i]);
res+=Math.log(N/curtag.hmpeople())*curtag.logfreq(p1)*curtag.logfreq(p2);
return res
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.*;

public class tagcl {
String tag;
Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public static void person()
{ if(hasIt.ContainsKey())
;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import java.util.*;

public class tagcl {
String tag;
Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
public int hmpeople()
{ return hashIt
}
public double logfreq(int p)
{ if(!hasIt.containsKey(p))
return -1;
int b;
b=hasIt.get(p);
return 1+Math.log(b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.util.HashMap;
import java.util.Map;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
alltags.put(tag, cltag);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

public class main {

public static void main(String[] args) {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.util.*;

public class tagcl {
String tag;
static Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public static void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
public static double logfreq(int p)
{ if(!hasIt.containsKey(p))
return -1;
int b;
b=hasIt.get(p);
return 1+Math.log(b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.util.*;

public class tagcl {
String tag;
static Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public static void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.*;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
alltags.put(tag, cltag);
}
//N is the number of total users in the system
//tags are the tags of the current person which is p1, p2 is the person to be compared
public static double similarity(String[] tags,int p1,int p2, int N)
{ tagcl curtag;
Set<String> tagset = new TreeSet<String>();
for (int i=0;i<tags.length;i++)
{ tagset.add(tags[i]);
}
String[] tagsar = new String(tagset.size());
tagsar= tagset.toArray(tagsar);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.*;

public class main {
static Map<String,tagcl> alltags;
public static void main(String[] args) {
// TODO Auto-generated method stub
alltags= new HashMap<String,tagcl>();
}
public static void newtag(int person,String tag)
{ tagcl cltag;
if(alltags.containsKey(tag))
cltag=alltags.get(tag);
else
cltag=new tagcl(tag);
cltag.person(person);
alltags.put(tag, cltag);
}
//N is the number of total users in the system
//tags are the tags of the current person which is p1, p2 is the person to be compared
public static double similarity(String[] tags,int p1,int p2, int N)
{ tagcl curtag;
Set<String> tagset = new TreeSet<String>();
for (int i=0;i<tags.length;i++)
{ tagset.add(tags[i]);
}
String[] tagsar;
tagsar= tagset.toArray(tagsar);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.util.*;

public class tagcl {
String tag;
static Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a;
hasIt= new HashMap<Integer, Integer>();
}
public static void person(int p)
{ int b=1;
if(hasIt.containsKey(p))
{ b=hasIt.get(p);
b+=1;
}
hasIt.put(p, b);
}
public static double logfreq(int p)
{ if(!hasIt.containsKey(p))
return -1;
int b;
b=hasit.get(p);
return 1+Math.log(b);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.*;

public class tagcl {
String tag
Map<Integer,Integer> hasIt;
tagcl(String a)
{ tag=a
hasIt= new HashMap<Integer, Integer>();
}
public static void person()
{ if(hasIt.ContainsKey())
;
}
}
Loading