Skip to content

Commit

Permalink
Added State and Zipcode classes
Browse files Browse the repository at this point in the history
  • Loading branch information
doolin committed Apr 10, 2012
1 parent 60ad0ed commit 6feba3b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.gch
exedisambig
txt2sqlite3
.fuse*
*.gdb
2 changes: 2 additions & 0 deletions DisambigCustomizedDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ template <> const string cAttribute_Basic<cLongitude >::attrib_group = "Patent";


template <> const string cAttribute_Basic<cStreet>::class_name = "Street";
template <> const string cAttribute_Basic<cState>::class_name = "State";
template <> const string cAttribute_Basic<cZipcode>::class_name = "Zipcode";


template <> const string cAttribute_Basic<cCountry>::class_name = "Country";
Expand Down
12 changes: 12 additions & 0 deletions DisambigCustomizedDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ class cStreet: public cAttribute_Single_Mode <cStreet> {

};

// Modeled after the Street class
class cState: public cAttribute_Single_Mode <cState> {
public:
cState(const char * source = NULL) {}
};

// Modeled after the Street class
class cZipcode: public cAttribute_Single_Mode <cZipcode> {
public:
cZipcode(const char * source = NULL) {}
};

class cCountry: public cAttribute_Single_Mode <cCountry> {
public:
static unsigned int const max_value = 2;
Expand Down
8 changes: 6 additions & 2 deletions DisambigEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2034,8 +2034,6 @@ bool fetch_records_from_txt(list <cRecord> & source, const char * txt_file, cons

std::cout << "Here3..." << std::endl;

if (i > 4) break;

if ( pointer_array[i]->get_attrib_group() != string("None") ) {
++position_in_ratios;
}
Expand Down Expand Up @@ -2159,6 +2157,12 @@ cAttribute * create_attribute_instance ( const string & id ) {
else if ( id == cStreet::static_get_class_name() ) {
p = new cStreet;
}
else if ( id == cState::static_get_class_name() ) {
p = new cState;
}
else if ( id == cZipcode::static_get_class_name() ) {
p = new cZipcode;
}
else if ( id == cCountry::static_get_class_name() ) {
p = new cCountry;
}
Expand Down
2 changes: 1 addition & 1 deletion config/engine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NUMBER OF THREADS = 2
GENERATE STABLE TRAINING SETS = true
USE AVAILABLE RATIOS DATABASE = false
THRESHOLDS = 0.99, 0.95
NECESSARY ATTRIBUTES = Firstname, Lastname, Street, City, State, Country, Zipcode, Lat, Lon, InvSeq, Patent, AppDateStr, Assignee, AsgNum, Class, coauths, invnum_N
NECESSARY ATTRIBUTES = Firstname, Lastname, Street, City, State, Country, Zipcode, Latitude, Longitude, InvSeq, Patent, AppDateStr, Assignee, AsgNum, Class, coauths, invnum_N
ADJUST PRIOR BY FREQUENCY = true
DEBUG MODE = false
NUMBER OF TRAINING PAIRS = 1000000
Expand Down
4 changes: 2 additions & 2 deletions data/invpat.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Firstname,Lastname,Street,City,State,Country,Zipcode,Lat,Lon,InvSeq,Patent,AppDateStr,Assignee,AsgNum,Class,coauths,invnum_N
Firstname,Lastname,Street,City,State,Country,Zipcode,Latitude,Longitude,InvSeq,Patent,AppDateStr,Assignee,AsgNum,Class,Coauthor,invnum_N
AARON J,TELLER,,WESTBOROUGH,MA,US,1582,4217,-7161,1,03859417,19710513/20020228,TELLER ENVIRONMENTAL SYSTEMS INC,10371134,,D.ROY-0/S.LIN-0/J.LAGARENNE-0,03859417-1
ABRAHAM,NUDELMAN,,REHOVOT,PA,IL,19004,3103,3456,1,03860581,19720204/20071227,YEDA RESEARCH AND DEVELOPMENT CO LTD,,514/544/564,A.REPHAELI-0/A.PATCHORNIK-0/R.MCCAULLY-0/I.GILAD-0/S.BELL-0/A.WEIZMAN-0/E.KEINAN-0/J.HERZIG-0/M.SHAKLAI-0/F.HAVIV-0,03860581-1
ABRAHAM A,DOR,,LAKEWOOD,OH,US,44107,4148,-8179,2,03860696,19710325/19751215,HANNA MINING COMPANY,,,P.MCGAULEY-0,03860696-2
Expand Down Expand Up @@ -1140,4 +1140,4 @@ ACHYUT,KANTAWALA,5 HASKELL ST APT 41,CAMBRIDGE,MA,US,2238,4237,-7111,1,D0510823,
AARON,CHU,,TAI-CHUNG,,TW,,2414,12068,0,D0513063,20040409/20060720,GLOBE UNION INDUSTRIAL CORP,,D23/D8/D6,K.HSUI-0/J.LAI-0,D0513063-0
AARON RICHARD,SERVIER,,SAN FRANCISCO,CA,US,94199,3777,-12241,1,D0513863,20041104,WARNERLAMBERT COMPANY LLC,10176720,D3/D9,R.ARKO-0/S.WAHL-0,D0513863-1
ADAM P,MALACHOWSKI,,LYNNWOOD,WA,US,98087,4787,-12227,4,D0515012,20041228/20050816,THE BOEING COMPANY,,D12,M.DRAKE-0/P.MIKULENCAK-0/R.EMERY-0/C.NELSON-0/V.STUHR-0/R.WONG-0/C.VEGTER-0/S.BROWN-0/M.EATKINS-0/M.EAKINS-0,D0515012-4
ADAM L,HILTUNEN,,CHESTERFIELD,MI,US,480
ADAM L,HILTUNEN,,CHESTERFIELD,MI,US,480

0 comments on commit 6feba3b

Please sign in to comment.