| 1 | |
|---|
| 2 | if (argc < 2) { |
|---|
| 3 | //wtsyntax(" "); |
|---|
| 4 | sprintf(reply+strlen(reply),"%s",cicopyr("Utility WTRIG2")); |
|---|
| 5 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 6 | #if SYNTAX |
|---|
| 7 | sprintf(reply+strlen(reply),"wtrig2 d[ocuments]=<mf1> c[ollection]=<mf2> \n"); |
|---|
| 8 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 9 | sprintf(reply+strlen(reply)," input document term vectors from <mf1>.v \n"); |
|---|
| 10 | sprintf(reply+strlen(reply)," input collection term vectors from <mf2>.v \n"); |
|---|
| 11 | sprintf(reply+strlen(reply)," output similar collection for each input document to <mf1>.y \n"); |
|---|
| 12 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 13 | sprintf(reply+strlen(reply)," options: maxrel=<max #related> [%"_LD_"] \n",PARMMAXREL); |
|---|
| 14 | sprintf(reply+strlen(reply)," minsim=<min similarity for related docs> [%3.1f] \n",PARMMINSIM); |
|---|
| 15 | sprintf(reply+strlen(reply)," maxsim=<max similarity for related docs> [%3.1f] \n",PARMMAXSIM); |
|---|
| 16 | sprintf(reply+strlen(reply)," dmfn=<tag> collapse doc.v as field <mf1>.v/<tag> [%s] \n",(parmcollapse)?itoa(parmcollapse,xa,10):""); |
|---|
| 17 | sprintf(reply+strlen(reply)," cmfn=<tag> collapse col.v as field <mf2>.v/<tag> [%s] \n",(parmcollmfntag)?itoa(parmcollmfntag,xa,10):""); |
|---|
| 18 | sprintf(reply+strlen(reply)," dlang=<tag> restrict col.v as field <mf1>.v/<tag> [%s] \n",(parmlanguage)?itoa(parmlanguage,xa,10):""); |
|---|
| 19 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 20 | sprintf(reply+strlen(reply)," doc.v=<mf> term vector for each document [document.v] \n"); |
|---|
| 21 | sprintf(reply+strlen(reply)," col.v=<mf> term vector for each collection doc [collection.v] \n"); |
|---|
| 22 | sprintf(reply+strlen(reply)," col.c=<mf> collection parms [collection.c] \n"); |
|---|
| 23 | sprintf(reply+strlen(reply)," col.n=<mf> terms in collection [collection.n] \n"); |
|---|
| 24 | sprintf(reply+strlen(reply)," col.x=<mf> posting list for each term [collection.x] \n"); |
|---|
| 25 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 26 | sprintf(reply+strlen(reply)," out.y=<mf> similar collection for each document [document.y] \n"); |
|---|
| 27 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 28 | //sprintf(reply+strlen(reply)," w2all weight also terms outside collection [%s] \n",(parmwsoma)?"w2all":""); |
|---|
| 29 | sprintf(reply+strlen(reply)," -w2all ignore doc terms outside collection [%s] \n",(parmwsoma)?"":"-w2all"); |
|---|
| 30 | sprintf(reply+strlen(reply)," [maxtv=<n>] trace[={1|2|4|8|16|32|64|3..127}] [%d] \n",parmtrace); |
|---|
| 31 | sprintf(reply+strlen(reply)," \n"); |
|---|
| 32 | #endif |
|---|
| 33 | return -1; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | /* get parameters */ |
|---|
| 38 | for (iarg=1; iarg < argc; iarg++) { |
|---|
| 39 | p=argv[iarg]; |
|---|
| 40 | if (parmtrace) sprintf(reply+strlen(reply),"+++ %s\n",p); |
|---|
| 41 | if (strncmp(p,"tell?",5) == 0 || strncmp(p,"tell=",5) == 0) { |
|---|
| 42 | if (sscanf(p+5,"%"_LD_,&parmtell) != 1) |
|---|
| 43 | { sprintf(reply,"+++ %s\n",p); return -1; } |
|---|
| 44 | parmtell2=parmtell; |
|---|
| 45 | continue; |
|---|
| 46 | } |
|---|
| 47 | if (strncmp(p,"tell2?",6) == 0 || strncmp(p,"tell2=",6) == 0) { |
|---|
| 48 | if (sscanf(p+6,"%"_LD_,&parmtell2) != 1) |
|---|
| 49 | { sprintf(reply,"+++ %s\n",p); return -1; } |
|---|
| 50 | continue; |
|---|
| 51 | } |
|---|
| 52 | if (strncmp(p,"trace?",6) == 0 || strncmp(p,"trace=",6) == 0) { |
|---|
| 53 | if (sscanf(p+6,"%d",&parmtrace) != 1) |
|---|
| 54 | { sprintf(reply,"+++ %s\n",p); return -1; } |
|---|
| 55 | continue; |
|---|
| 56 | } |
|---|
| 57 | if (strcmp(p,"trace") == 0) { |
|---|
| 58 | parmtrace2=1; |
|---|
| 59 | parmtrace=127; |
|---|
| 60 | continue; |
|---|
| 61 | } |
|---|
| 62 | if (strcmp(p,"trace1") == 0) { |
|---|
| 63 | parmtrace2=0; |
|---|
| 64 | parmtrace=1; |
|---|
| 65 | continue; |
|---|
| 66 | } |
|---|
| 67 | } |
|---|