-
Notifications
You must be signed in to change notification settings - Fork 17
Search system in .jwpub #106
Comments
Nothing? |
@livrasand Do you know how work? |
No me he fijado cómo funciona... pero investigaré en los próximos días, y haré un artículo en la wiki. Muchas gracias por esta buena función 👍🏻 |
Esto es todo lo que falta en mi .jwpub personal, se ve hermoso. ajajaj |
it seems that the But yeah, I don't have so much clue about how it works, just that all these tables complement each other on JW search engine. |
any update? |
Hola @gokusander, aun no, no he tenido tiempo... he estado trabajando en otros proyectos.
That's right @orangethewell, they are encrypted with another method. You just have to re-encrypt new search queries. |
This is the code responsible for processing searches. package h.c.d.a.j;
import android.database.Cursor;
import h.c.e.b.a;
import java.util.ArrayList;
import java.util.Locale;
import org.sqlite.database.sqlite.SQLiteDatabase;
class c$f {
private final a a;
private final String b;
private final String c;
final c d;
c$f(c var1, a var2, String var3, String var4) {
this.d = var1;
this.a = var2;
this.b = var3;
this.c = var4;
}
private byte[] e(int var1) {
String var3 = String.format(Locale.US, "SELECT PositionalList FROM %s WHERE WordId=%d", this.b, var1);
SQLiteDatabase var2 = this.a.i();
byte[] var10;
try {
var10 = j.c(var2, var3);
} catch (Throwable var9) {
if (var2 != null) {
try {
var2.close();
} catch (Throwable var8) {
var9.addSuppressed(var8);
throw var9;
}
}
throw var9;
}
if (var2 != null) {
var2.close();
}
return var10;
}
private byte[] f(int var1) {
String var3 = String.format(Locale.US, "SELECT PositionalListIndex FROM %s WHERE WordId=%d", this.b, var1);
SQLiteDatabase var2 = this.a.i();
byte[] var10;
try {
var10 = j.c(var2, var3);
} catch (Throwable var9) {
if (var2 != null) {
try {
var2.close();
} catch (Throwable var8) {
var9.addSuppressed(var8);
throw var9;
}
}
throw var9;
}
if (var2 != null) {
var2.close();
}
return var10;
}
private byte[] g(int var1) {
String var3 = String.format(Locale.US, "SELECT ScopeParagraphData FROM %s WHERE TextUnitId=%d", this.c, var1);
SQLiteDatabase var2 = this.a.i();
byte[] var10;
try {
var10 = j.c(var2, var3);
} catch (Throwable var9) {
if (var2 != null) {
try {
var2.close();
} catch (Throwable var8) {
var9.addSuppressed(var8);
throw var9;
}
}
throw var9;
}
if (var2 != null) {
var2.close();
}
return var10;
}
private void h(int var1, byte[][] var2) {
String var4 = String.format(Locale.US, "SELECT TextPositions, TextLengths FROM %s WHERE TextUnitId=%d", this.c, var1);
SQLiteDatabase var3 = this.a.i();
label433: {
Throwable var10000;
Throwable var61;
label434: {
boolean var10001;
Cursor var62;
try {
var62 = var3.rawQuery(var4, (String[])null);
} catch (Throwable var60) {
var10000 = var60;
var10001 = false;
break label434;
}
try {
if (var62.moveToFirst()) {
var2[0] = var62.getBlob(0);
var2[1] = var62.getBlob(1);
}
} catch (Throwable var59) {
var61 = var59;
if (var62 != null) {
try {
var62.close();
} catch (Throwable var57) {
Throwable var63 = var57;
label415:
try {
var61.addSuppressed(var63);
break label415;
} catch (Throwable var56) {
var10000 = var56;
var10001 = false;
break label434;
}
}
}
try {
throw var61;
} catch (Throwable var55) {
var10000 = var55;
var10001 = false;
break label434;
}
}
label422:
try {
var62.close();
break label433;
} catch (Throwable var58) {
var10000 = var58;
var10001 = false;
break label422;
}
}
var61 = var10000;
if (var3 != null) {
try {
var3.close();
} catch (Throwable var54) {
var61.addSuppressed(var54);
throw var61;
}
}
throw var61;
}
var3.close();
}
private byte[] i(int var1, int[] var2) {
String var4 = String.format(Locale.US, "SELECT TextUnitCount, TextUnitIndices FROM %s WHERE WordId=%d", this.b, var1);
SQLiteDatabase var3 = this.a.i();
Throwable var77;
Throwable var10000;
label557: {
Cursor var79;
boolean var10001;
try {
var79 = var3.rawQuery(var4, (String[])null);
} catch (Throwable var76) {
var10000 = var76;
var10001 = false;
break label557;
}
byte[] var78;
label558: {
try {
if (var79.moveToFirst()) {
var2[0] = var79.getInt(0);
var78 = var79.getBlob(1);
break label558;
}
} catch (Throwable var75) {
var77 = var75;
if (var79 != null) {
try {
var79.close();
} catch (Throwable var72) {
Throwable var80 = var72;
label531:
try {
var77.addSuppressed(var80);
break label531;
} catch (Throwable var71) {
var10000 = var71;
var10001 = false;
break label557;
}
}
}
try {
throw var77;
} catch (Throwable var70) {
var10000 = var70;
var10001 = false;
break label557;
}
}
try {
var79.close();
} catch (Throwable var74) {
var10000 = var74;
var10001 = false;
break label557;
}
var3.close();
var2[0] = 0;
return null;
}
try {
var79.close();
} catch (Throwable var73) {
var10000 = var73;
var10001 = false;
break label557;
}
var3.close();
return var78;
}
var77 = var10000;
if (var3 != null) {
try {
var3.close();
} catch (Throwable var69) {
var77.addSuppressed(var69);
throw var77;
}
}
throw var77;
}
public c.i a(int var1) {
byte[] var5 = this.f(var1);
byte[] var3 = this.e(var1);
ArrayList var4 = new ArrayList();
int var2 = 0;
var1 = 0;
int[] var6;
while(var2 < var5.length) {
var6 = new int[]{0};
var2 += j.a(var5, var2, var6);
var1 += var6[0];
var4.add(var1);
}
ArrayList var7 = new ArrayList();
var1 = 0;
while(var1 < var3.length) {
var6 = new int[]{0};
var1 += j.a(var3, var1, var6);
var7.add(var6[0]);
}
return new c.f.b(this, var4, var7);
}
public c.j b(int var1) {
return new c.f.c(this, new h.c.d.a.j.a(this.g(var1), 0));
}
public c.n c(int var1) {
byte[][] var3 = new byte[][]{null, null};
this.h(var1, var3);
byte[] var5 = var3[0];
byte[] var7 = var3[1];
ArrayList var4 = new ArrayList();
int var2 = 0;
var1 = 0;
int[] var6;
while(var2 < var5.length) {
var6 = new int[]{0};
var2 += j.a(var5, var2, var6);
var1 += var6[0];
var4.add(var1);
}
ArrayList var8 = new ArrayList();
var1 = 0;
while(var1 < var7.length) {
var6 = new int[]{0};
var1 += j.a(var7, var1, var6);
var8.add(var6[0]);
}
return new c.f.d(this, var4, var8);
}
public c.p d(int var1, boolean var2) {
int[] var9 = new int[]{0};
byte[] var8 = this.i(var1, var9);
int var7 = var9[0];
int[] var10 = new int[var7];
int var4 = 0;
int var3 = 0;
int var5 = 0;
int var6;
for(var1 = 0; var4 < var7; var1 = var6) {
label15: {
var9 = new int[]{0};
var5 += j.a(var8, var5, var9);
var6 = var1 + var9[0];
if (var2) {
var1 = var3;
if (var6 >= 10000) {
break label15;
}
}
var10[var3] = var6;
var1 = var3 + 1;
}
++var4;
var3 = var1;
}
return new c.f.a(this, var3, var10);
}
} |
@orangethewell , any ideas? |
I don't know yet, I'm still researching the JW Library source code in my free time. But the answer must be in the code snippet I uploaded for this conversion. If you have the chance to study it, I would be very grateful. |
Tipo de problema
Otro
Descripción
Me gustaría utilizar el sistema de búsqueda. no lo encontré en la wiki. Creé otro issue para estar separado.
The text was updated successfully, but these errors were encountered: