intersection = TermPage.intersectPageTitles(tp_list1, tp_list2);
58 | assertTrue(intersection.size() > 0);
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/index.txt:
--------------------------------------------------------------------------------
1 | wikokit (c) 2005-2013, Andrew dot Krizhanovsky at gmail.com
2 | http://code.google.com/p/wikokit/
3 |
4 | Previous project name Synarcher...
5 | Previous site: https://sourceforge.net/projects/synarcher
6 |
7 | Wiki tool kit (wikokit) contains several projects related to wiki
8 | (you can open these projects in NetBeans IDE):
9 |
10 | ./common_wiki - common (low-level) functions for access to Wikipedia and
11 | Wiktionary in MySQL database,
12 |
13 | ./hits_wiki (old title kleinberg)
14 | - API for access to Wikipedia in MySQL database,
15 | algorithms to search synonyms in Wikipedia
16 | (depends on jcfd.jar, common_wiki.jar).
17 |
18 | ./TGWikiBrowser - visual browser to search for synonyms in local or
19 | remote Wikipedia (depends on hits_wiki.jar and common_wiki.jar)
20 |
21 | ./wikidf - Wiki Index Database (list of lemmas and links to wiki pages,
22 | which contain these lemmas). See ./wikidf/readme.txt
23 |
24 | ./wikt_parser - Wiktionary parser creates a MySQL database (like WordNet)
25 | from an Wiktionary MySQL dump file. The project goal is to
26 | convert Wiktionary articles to machine readable format.
27 | (It depends on common_wiki.)
28 |
29 | ./jcfd - Java client for Dict is written by Davor Cengija,
30 | Apache License, Version 1.1.
31 | (jcfd.jar is used in hits_wiki.jar in order to compare search
32 | results with thesauri WordNet and Moby. It is not yet
33 | incorporated into binary version of the program Synarcher).
34 |
35 | See gpl.txt and "notice" for license details.
--------------------------------------------------------------------------------
/jcfd/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=ebcb4f4b
2 | build.xml.script.CRC32=efa2246d
3 | build.xml.stylesheet.CRC32=958a1d3e
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=ebcb4f4b
7 | nbproject/build-impl.xml.script.CRC32=3adcbd00
8 | nbproject/build-impl.xml.stylesheet.CRC32=e55b27f5
9 |
--------------------------------------------------------------------------------
/jcfd/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | jcfd
7 | 1.6.5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/Definition.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import java.io.Serializable;
4 |
5 |
6 | /**
7 | * Definition object contains the definition (translation) received from the DICT server.
8 | *
9 | *
10 | * @author Davor Cengija
11 | * @version $Revision: 1.1.1.1 $
12 | *
13 | * @see net.zuckerfrei.jcfd.Dict#define(String)
14 | * @see net.zuckerfrei.jcfd.Database
15 | */
16 | public interface Definition
17 | extends Serializable
18 | {
19 |
20 | //~ Methods ===============================================================
21 |
22 | /**
23 | * The content of the definition. Returned as Object
so that we can have different
24 | * return types, e.g. org.w3c.dom.Node
.
25 | *
26 | * @return Object the very content returned from the server.
27 | */
28 | public Object getContent();
29 |
30 |
31 | /**
32 | * Gets the database this definition is comming from.
33 | *
34 | * @return Database
35 | */
36 | public Database getDatabase();
37 |
38 |
39 | /**
40 | * Returns the links (references) found in this definition. Links are used to search
41 | * another definitions which are in some corelation with this one. E.g. when defining "linux"
42 | * you'll probably have links to "FSF" and "GNU".
43 | *
44 | * @return String[] containing words for easy defining.
45 | */
46 | public String[] getLinks();
47 |
48 |
49 | /**
50 | * Gets the word this definition is for. This is the same word as send to {@link Dict#define(String)}.
51 | *
52 | * @return String word.
53 | */
54 | public String getWord();
55 | }
56 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/DictException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import org.apache.commons.lang.exception.NestableException;
4 |
5 |
6 | /**
7 | * DOCUMENT ME!
8 | *
9 | * @author Davor Cengija
10 | * @version $Revision: 1.1.1.1 $
11 | */
12 | public class DictException
13 | extends NestableException
14 | {
15 |
16 | //~ Constructors ==========================================================
17 |
18 | /**
19 | * Constructor for DictException.
20 | */
21 | public DictException() {
22 | super();
23 | }
24 |
25 |
26 | /**
27 | * Constructor for DictException.
28 | *
29 | * @param arg0
30 | */
31 | public DictException(String arg0) {
32 | super(arg0);
33 | }
34 |
35 |
36 | /**
37 | * Constructor for DictException.
38 | *
39 | * @param arg0
40 | */
41 | public DictException(Throwable arg0) {
42 | super(arg0);
43 | }
44 |
45 |
46 | /**
47 | * Constructor for DictException.
48 | *
49 | * @param arg0
50 | * @param arg1
51 | */
52 | public DictException(String arg0, Throwable arg1) {
53 | super(arg0, arg1);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/InvalidDatabaseException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author administrator To change this generated comment edit the template
7 | * variable "typecomment": Window>Preferences>Java>Templates. To
8 | * enable and disable the creation of type comments go to
9 | * Window>Preferences>Java>Code Generation.
10 | */
11 | public class InvalidDatabaseException
12 | extends DictException
13 | {
14 |
15 | //~ Constructors ==========================================================
16 |
17 | /**
18 | * Constructor for InvalidDatabaseException.
19 | */
20 | public InvalidDatabaseException() {
21 | super();
22 | }
23 |
24 |
25 | /**
26 | * Constructor for InvalidDatabaseException.
27 | *
28 | * @param arg0
29 | */
30 | public InvalidDatabaseException(String arg0) {
31 | super(arg0);
32 | }
33 |
34 |
35 | /**
36 | * Constructor for InvalidDatabaseException.
37 | *
38 | * @param arg0
39 | */
40 | public InvalidDatabaseException(Throwable arg0) {
41 | super(arg0);
42 | }
43 |
44 |
45 | /**
46 | * Constructor for InvalidDatabaseException.
47 | *
48 | * @param arg0
49 | * @param arg1
50 | */
51 | public InvalidDatabaseException(String arg0, Throwable arg1) {
52 | super(arg0, arg1);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/InvalidResponseException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author administrator To change this generated comment edit the template
7 | * variable "typecomment": Window>Preferences>Java>Templates. To
8 | * enable and disable the creation of type comments go to
9 | * Window>Preferences>Java>Code Generation.
10 | */
11 | public class InvalidResponseException
12 | extends DictException
13 | {
14 |
15 | //~ Constructors ==========================================================
16 |
17 | /**
18 | * Constructor for InvalidResponseException.
19 | */
20 | public InvalidResponseException() {
21 | super();
22 | }
23 |
24 |
25 | /**
26 | * Constructor for InvalidResponseException.
27 | *
28 | * @param arg0
29 | */
30 | public InvalidResponseException(String arg0) {
31 | super(arg0);
32 | }
33 |
34 |
35 | /**
36 | * Constructor for InvalidResponseException.
37 | *
38 | * @param arg0
39 | */
40 | public InvalidResponseException(Throwable arg0) {
41 | super(arg0);
42 | }
43 |
44 |
45 | /**
46 | * Constructor for InvalidResponseException.
47 | *
48 | * @param arg0
49 | * @param arg1
50 | */
51 | public InvalidResponseException(String arg0, Throwable arg1) {
52 | super(arg0, arg1);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/InvalidStrategyException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author Davor Cengija $Revision: 1.1.1.1 $ To change this generated comment
7 | * edit the template variable "typecomment":
8 | * Window>Preferences>Java>Templates. To enable and disable the
9 | * creation of type comments go to Window>Preferences>Java>Code
10 | * Generation.
11 | */
12 | public class InvalidStrategyException
13 | extends DictException
14 | {
15 |
16 | //~ Constructors ==========================================================
17 |
18 | /**
19 | * Constructor for InvalidStrategyException.
20 | */
21 | public InvalidStrategyException() {
22 | super();
23 | }
24 |
25 |
26 | /**
27 | * Constructor for InvalidStrategyException.
28 | *
29 | * @param arg0
30 | */
31 | public InvalidStrategyException(String arg0) {
32 | super(arg0);
33 | }
34 |
35 |
36 | /**
37 | * Constructor for InvalidStrategyException.
38 | *
39 | * @param arg0
40 | */
41 | public InvalidStrategyException(Throwable arg0) {
42 | super(arg0);
43 | }
44 |
45 |
46 | /**
47 | * Constructor for InvalidStrategyException.
48 | *
49 | * @param arg0
50 | * @param arg1
51 | */
52 | public InvalidStrategyException(String arg0, Throwable arg1) {
53 | super(arg0, arg1);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/Match.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * Match
is the result of the query using a particular strategy. It contains the word found and the database the word is found in.
5 | *
6 | *
7 | * @author Davor Cengija
8 | * @version $Revision: 1.1.1.1 $
9 | *
10 | * @see net.zuckerfrei.jcfd.Strategy
11 | * @see net.zuckerfrei.jcfd.Definition
12 | * @see net.zuckerfrei.jcfd.Database
13 | * @see net.zuckerfrei.jcfd.MatchList
14 | * @see net.zuckerfrei.jcfd.Dict#match(String)
15 | * @see net.zuckerfrei.jcfd.Dict#define(Match)
16 | * @see net.zuckerfrei.jcfd.Dict#define(MatchList)
17 | */
18 | public class Match {
19 |
20 | //~ Instance variables ====================================================
21 |
22 | /** Word found in the database. */
23 | private String word;
24 |
25 | /** The database the word is found in. */
26 | private Database database;
27 |
28 | //~ Constructors ==========================================================
29 |
30 | /**
31 | * Creates a new Match object.
32 | *
33 | * @param database The database the word is found in.
34 | * @param word The word found.
35 | *
36 | * @see Database
37 | */
38 | public Match(Database database, String word) {
39 | this.word = word;
40 | this.database = database;
41 | }
42 |
43 | //~ Methods ===============================================================
44 |
45 | /**
46 | * Returns the database.
47 | *
48 | * @return Database
49 | */
50 | public Database getDatabase() {
51 | return database;
52 | }
53 |
54 |
55 | /**
56 | * Returns the word.
57 | *
58 | * @return String
59 | */
60 | public String getWord() {
61 | return word;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/NoDatabasesException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * An exception indicating that no databases are present on the DICT server.
5 | * That usually means that DICT server is not configured properly.
6 | */
7 | public class NoDatabasesException
8 | extends DictException
9 | {
10 |
11 | //~ Constructors ==========================================================
12 |
13 | /**
14 | * Constructor for NoDatabasesException.
15 | */
16 | public NoDatabasesException() {
17 | super();
18 | }
19 |
20 |
21 | /**
22 | * Constructor for NoDatabasesException.
23 | *
24 | * @param message
25 | */
26 | public NoDatabasesException(String arg0) {
27 | super(arg0);
28 | }
29 |
30 |
31 | /**
32 | * Constructor for NoDatabasesException.
33 | *
34 | * @param arg0
35 | */
36 | public NoDatabasesException(Throwable arg0) {
37 | super(arg0);
38 | }
39 |
40 |
41 | /**
42 | * Constructor for NoDatabasesException.
43 | *
44 | * @param arg0
45 | * @param arg1
46 | */
47 | public NoDatabasesException(String arg0, Throwable arg1) {
48 | super(arg0, arg1);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/NoStrategiesException.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author Davor Cengija
7 | * @version $Revision: 1.1.1.1 $
8 | */
9 | public class NoStrategiesException
10 | extends DictException
11 | {
12 |
13 | //~ Constructors ==========================================================
14 |
15 | /**
16 | * Constructor for NoStrategiesException.
17 | */
18 | public NoStrategiesException() {
19 | super();
20 | }
21 |
22 |
23 | /**
24 | * Constructor for NoStrategiesException.
25 | *
26 | * @param arg0
27 | */
28 | public NoStrategiesException(String arg0) {
29 | super(arg0);
30 | }
31 |
32 |
33 | /**
34 | * Constructor for NoStrategiesException.
35 | *
36 | * @param arg0
37 | */
38 | public NoStrategiesException(Throwable arg0) {
39 | super(arg0);
40 | }
41 |
42 |
43 | /**
44 | * Constructor for NoStrategiesException.
45 | *
46 | * @param arg0
47 | * @param arg1
48 | */
49 | public NoStrategiesException(String arg0, Throwable arg1) {
50 | super(arg0, arg1);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/simple/SimpleDefinitionFactory.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd.simple;
2 |
3 | import net.zuckerfrei.jcfd.Database;
4 | import net.zuckerfrei.jcfd.Definition;
5 | import net.zuckerfrei.jcfd.DefinitionFactory;
6 |
7 | /**
8 | * Factory for creating simple definition objects.
9 | * @author Davor Cengija
10 | * @version $Revision: 1.1.1.1 $
11 | *
12 | * @see net.zuckerfrei.jcfd.Definition
13 | * @see net.zuckerfrei.jcfd.simple.SimpleDefinition
14 | * @see net.zuckerfrei.jcfd.Configuration
15 | */
16 | public class SimpleDefinitionFactory extends DefinitionFactory {
17 |
18 | /**
19 | * @see net.zuckerfrei.jcfd.DefinitionFactory#createDefinition(String,Database,Object)
20 | */
21 | public Definition createDefinition(String word, Database database, Object content) {
22 | return new SimpleDefinition(word, database, (String) content);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/simple/SimpleDict.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd.simple;
2 |
3 | import net.zuckerfrei.jcfd.DictException;
4 | import net.zuckerfrei.jcfd.DictImpl;
5 | import org.apache.commons.logging.Log;
6 | import org.apache.commons.logging.LogFactory;
7 |
8 | /**
9 | * DOCUMENT ME!
10 | *
11 | * @author Davor Cengija
12 | * @version $Revision: 1.1.1.1 $
13 | */
14 | class SimpleDict extends DictImpl {
15 |
16 | //~ Static variables/initializers =========================================
17 |
18 | static Log log = LogFactory.getLog(SimpleDict.class);
19 |
20 | //~ Constructors ==========================================================
21 |
22 | /**
23 | * Constructor SimpleConnection.
24 | *
25 | * @param host
26 | * @param port
27 | *
28 | * @throws DictException DOCUMENT ME!
29 | */
30 | SimpleDict(String host, int port) throws DictException {
31 | super(host, port);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/jcfd/src/net/zuckerfrei/jcfd/simple/SimpleDictFactory.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd.simple;
2 |
3 | import net.zuckerfrei.jcfd.Configuration;
4 | import net.zuckerfrei.jcfd.Dict;
5 | import net.zuckerfrei.jcfd.DictException;
6 | import net.zuckerfrei.jcfd.DictFactory;
7 |
8 |
9 | /**
10 | * DOCUMENT ME!
11 | *
12 | * @author Davor Cengija
13 | * @version $Revision: 1.1.1.1 $
14 | * @deprecated
15 | */
16 | public class SimpleDictFactory
17 | extends DictFactory
18 | {
19 |
20 | //~ Methods ===============================================================
21 |
22 | /**
23 | * @see net.zuckerfrei.jcfd.DictFactory#getDictClient()
24 | */
25 | public Dict getDictClient()
26 | throws DictException
27 | {
28 | return new SimpleDict(Configuration.getInstance().getHost(),
29 | Configuration.getInstance().getPort());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/AllTests.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import junit.framework.Test;
4 | import junit.framework.TestSuite;
5 |
6 | import net.zuckerfrei.jcfd.simple.SimpleDictTest;
7 |
8 | /**
9 | * DOCUMENT ME!
10 | *
11 | * @author Davor Cengija
12 | * @version $Revision: 1.1.1.1 $
13 | */
14 | public class AllTests {
15 |
16 | //~ Methods ===============================================================
17 |
18 | /**
19 | * DOCUMENT ME!
20 | *
21 | * @param args DOCUMENT ME!
22 | */
23 | public static void main(String[] args) {
24 | junit.textui.TestRunner.run(AllTests.class);
25 | }
26 |
27 | /**
28 | * DOCUMENT ME!
29 | *
30 | * @return DOCUMENT ME!
31 | */
32 | public static Test suite() {
33 |
34 | TestSuite suite = new TestSuite("Test for net.zuckerfrei.jcfd");
35 |
36 | //$JUnit-BEGIN$
37 | suite.addTest(new TestSuite(DefinitionListTest.class));
38 | suite.addTest(new TestSuite(DictTest.class));
39 | suite.addTest(new TestSuite(MatchListTest.class));
40 | suite.addTest(new TestSuite(ResponseTest.class));
41 | suite.addTest(new TestSuite(ConfigurationTest.class));
42 | suite.addTest(new TestSuite(ConfigurationFromSystemTest.class));
43 | //$JUnit-END$
44 | return suite;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/MockBufferedReader.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.Reader;
6 | import java.io.StringReader;
7 |
8 |
9 | /**
10 | * DOCUMENT ME!
11 | *
12 | * @author Davor Cengija
13 | * @version $Revision: 1.1.1.1 $
14 | */
15 | public class MockBufferedReader
16 | extends BufferedReader
17 | {
18 |
19 | //~ Instance variables ====================================================
20 |
21 | /**
22 | * DOCUMENT ME!
23 | */
24 | public String[] content;
25 |
26 | /**
27 | * DOCUMENT ME!
28 | */
29 | public int position = 0;
30 |
31 | /**
32 | * DOCUMENT ME!
33 | */
34 | public int readLineCount = 0;
35 |
36 | //~ Constructors ==========================================================
37 |
38 | /**
39 | * Constructor for MockBufferedReader.
40 | *
41 | * @param in
42 | * @param sz
43 | */
44 | public MockBufferedReader(Reader in, int sz) {
45 | super(in, sz);
46 | }
47 |
48 |
49 | /**
50 | * Constructor for MockBufferedReader.
51 | *
52 | * @param in
53 | */
54 | public MockBufferedReader(Reader in) {
55 | super(new StringReader("mock"));
56 | }
57 |
58 | //~ Methods ===============================================================
59 |
60 | /**
61 | * DOCUMENT ME!
62 | *
63 | * @param content DOCUMENT ME!
64 | */
65 | public void setContent(String[] content) {
66 | this.content = content;
67 | }
68 |
69 |
70 | /**
71 | * @see java.io.BufferedReader#readLine()
72 | */
73 | public String readLine()
74 | throws IOException
75 | {
76 | readLineCount++;
77 | return content[position++];
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/MockDataOutputStream.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.OutputStream;
6 |
7 |
8 | /**
9 | * DOCUMENT ME!
10 | *
11 | * @author administrator To change this generated comment edit the template
12 | * variable "typecomment": Window>Preferences>Java>Templates. To
13 | * enable and disable the creation of type comments go to
14 | * Window>Preferences>Java>Code Generation.
15 | */
16 | public class MockDataOutputStream
17 | extends DataOutputStream
18 | {
19 |
20 | //~ Constructors ==========================================================
21 |
22 | /**
23 | * Constructor for MockDataOutputStream.
24 | *
25 | * @param out
26 | */
27 | public MockDataOutputStream(OutputStream out) {
28 | super(new ByteArrayOutputStream());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/MockDefinition.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author Davor Cengija
7 | * @version $Revision: 1.1.1.1 $
8 | */
9 | public class MockDefinition
10 | implements Definition
11 | {
12 |
13 | //~ Constructors ==========================================================
14 |
15 | /**
16 | * Constructor for MockDefinition.
17 | */
18 | public MockDefinition() {
19 | super();
20 | }
21 |
22 | //~ Methods ===============================================================
23 |
24 | /**
25 | * @see net.zuckerfrei.jcfd.Definition#getContent()
26 | */
27 | public Object getContent() {
28 | return null;
29 | }
30 |
31 |
32 | /**
33 | * @see net.zuckerfrei.jcfd.Definition#getDatabase()
34 | */
35 | public Database getDatabase() {
36 | return null;
37 | }
38 |
39 |
40 | /**
41 | * @see net.zuckerfrei.jcfd.Definition#getLinks()
42 | */
43 | public String[] getLinks() {
44 | return null;
45 | }
46 | /**
47 | * @see net.zuckerfrei.jcfd.Definition#getWord()
48 | */
49 | public String getWord() {
50 | return null;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/MockDict.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | /**
4 | * DOCUMENT ME!
5 | *
6 | * @author Davor Cengija
7 | * @version $Revision: 1.1.1.1 $
8 | */
9 | public class MockDict
10 | extends DictImpl
11 | {
12 |
13 | //~ Constructors ==========================================================
14 |
15 | /**
16 | * Constructor for MockDict.
17 | *
18 | * @param host
19 | * @param port
20 | *
21 | * @throws DictException
22 | */
23 | public MockDict(String host, int port)
24 | throws DictException
25 | {
26 |
27 | // super(host, port);
28 | connected = true;
29 | }
30 |
31 | //~ Methods ===============================================================
32 |
33 | /**
34 | * @see net.zuckerfrei.jcfd.Dict#define(String, Database)
35 | */
36 | public DefinitionList define(String word, Database database)
37 | throws DictException
38 | {
39 | return null;
40 | }
41 |
42 |
43 | /**
44 | * @see net.zuckerfrei.jcfd.Dict#match(String, Strategy, Database)
45 | */
46 | public MatchList match(String word, Strategy strategy, Database database)
47 | throws DictException
48 | {
49 | return null;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jcfd/test/net/zuckerfrei/jcfd/MockResourceBundle.java:
--------------------------------------------------------------------------------
1 | package net.zuckerfrei.jcfd;
2 |
3 | import java.util.Enumeration;
4 | import java.util.MissingResourceException;
5 | import java.util.ResourceBundle;
6 |
7 | /**
8 | * @author Davor Cengija
9 | * @version $Revision: 1.1.1.1 $
10 | */
11 | public class MockResourceBundle extends ResourceBundle {
12 |
13 | String hostname;
14 | String port;
15 | String clientFactory;
16 | String definitionFactory;
17 |
18 | /**
19 | * Constructor for MockResourceBundle.
20 | */
21 | public MockResourceBundle(String hostname, String port, String clientFactory, String definitionFactory) {
22 | super();
23 | this.hostname = hostname;
24 | this.port = port;
25 | this.clientFactory = clientFactory;
26 | this.definitionFactory = definitionFactory;
27 | }
28 |
29 | /**
30 | * @see java.util.ResourceBundle#handleGetObject(String)
31 | */
32 | protected Object handleGetObject(String key) throws MissingResourceException {
33 | if (key.equals(Configuration.SERVER_NAME_KEY)) {
34 | return hostname;
35 | }
36 | else if (key.equals(Configuration.SERVER_PORT_KEY)) {
37 | return port;
38 | }
39 | else if (key.equals(Configuration.CLIENT_FACTORY_KEY)) {
40 | return clientFactory;
41 | }
42 | else if (key.equals(Configuration.DEFINITION_FACTORY_KEY)) {
43 | return definitionFactory;
44 | }
45 |
46 | return null;
47 | }
48 |
49 | /**
50 | * @see java.util.ResourceBundle#getKeys()
51 | */
52 | public Enumeration getKeys() {
53 | return null;
54 | }
55 |
56 | public static void main(String[] args) {
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/media_commons/image.py/doc/statistics_ideas_etc.txt:
--------------------------------------------------------------------------------
1 | 1) Get filename from database
2 | Sawhorse.png
3 |
4 | 2) Get JSON file with URL
5 | https://commons.wikimedia.org/w/api.php?action=query&titles=File:Sawhorse.png&prop=imageinfo&iiprop=url&iiurlwidth=220
6 |
7 | 3) wget image URL
8 |
9 | statistics
10 |
11 | ruwikt20180601_parsed
12 |
13 | 40162 pairs image-meaning (only {{илл}} without {{илл.}}, last template was not taken into accout by error)
14 | SELECT COUNT(*) FROM image, image_meaning WHERE image_meaning.image_id=image.id;
15 |
16 | 1. skip indecent images with parameter hide=1,
17 |
18 | 2. skip indecent images with meaning labels: сексол., обсц.
19 |
20 | ?1. Calculate number of POS with images
21 |
22 | ?2. Calculate number of images by lang
23 |
--------------------------------------------------------------------------------
/media_commons/image.py/src/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/media_commons/image.py/src/__init__.py
--------------------------------------------------------------------------------
/media_commons/image.py/src/lib/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/media_commons/image.py/src/lib/__init__.py
--------------------------------------------------------------------------------
/media_commons/image.py/src/lib/create_thumb_url.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | import json
5 | import urllib
6 | import requests
7 |
8 |
9 | # Creates thumb image URL by filename and required width.
10 | # filename - name of file at Commons
11 | def createThumbImageURL( filename, width ):
12 | "Creates thumb image URL by filename and required width"
13 |
14 | # 1. create Wikimedia Commons JSON URL with desired search parameters, see https://www.mediawiki.org/wiki/API:Imageinfo
15 | # e.g. https://commons.wikimedia.org/w/api.php?action=query&titles=File:Sawhorse.png&prop=imageinfo&iiprop=url&iiurlwidth=220
16 |
17 | url = "https://commons.wikimedia.org/w/api.php?"
18 | url = url + "action=query"
19 | url = url + "&titles=File:" + filename
20 | url = url + "&prop=imageinfo&iiprop=url"
21 | url = url + "&iiurlwidth=" + str(width)
22 | url = url + "&format=json"
23 | # print url # debug
24 |
25 |
26 | # 2. parse result JSON
27 | # return .query.pages.pages[0].imageinfo.thumburl
28 |
29 | # how to get two parameters at once?:
30 | # .query.pages.pages[0].imageinfo.thumbheight
31 |
32 | req = requests.get(url)
33 | data =json.loads(req.content)
34 | # print data
35 | # print data['query']['pages']
36 | # print data['query']['pages']['750085']
37 |
38 | thumburl = ""
39 | thumbheight = -1
40 | for page in data["query"]["pages"].values():
41 | thumburl = page["imageinfo"][0]['thumburl']
42 | thumbheight = page["imageinfo"][0]['thumbheight']
43 | break
44 |
45 | # print "createThumbImageURL: thumbheight={0}, thumburl={1}".format( thumbheight, thumburl )
46 |
47 | return {'thumburl':thumburl, 'thumbheight':thumbheight}
48 |
49 |
--------------------------------------------------------------------------------
/piwidict/lib/header.php:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 | piwidict - PHP framework to work with Wiktionary parsed database
7 |
8 |
14 |
15 |
22 |
23 |
30 |
31 |
32 | NB!
33 | Attention: beta-testing mode
34 |
35 | "; // debug
37 | // print "Session _user_password = ".$_SESSION['_user_password']."
";
38 |
39 | ?>
40 |
41 |
42 |
--------------------------------------------------------------------------------
/piwidict/lib/sql/tpage.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/piwidict/lib/sql/tpos.php:
--------------------------------------------------------------------------------
1 | Array ( [id] => 39 [name] => noun )
35 |
36 | foreach ($pos_all as $key => $value) {
37 | if($id == $value['id']) {
38 | return (object) array('id' => $id, 'name' => $value['name']);
39 | }
40 | }
41 | return NULL;
42 | }
43 |
44 | /* Gets ID from the table 'part_of_speech' by the part of speech name, e.g. "noun", "verb", "phrase".
45 | * Returns NULL if it is unknown name.
46 | */
47 | static public function getIDByName($pos_all, $_name) {
48 |
49 | foreach ($pos_all as $key => $value) {
50 | if($_name == $value['name'])
51 | return $key;
52 | }
53 | return NULL;
54 | }
55 |
56 | }
57 | ?>
--------------------------------------------------------------------------------
/piwidict/readme.txt:
--------------------------------------------------------------------------------
1 | wikokit (c) 2005-2013, Andrew dot Krizhanovsky at gmail.com
2 |
3 | piwidict - PHP framework to work with Wiktionary parsed database.
4 |
5 | piwidict = PHP+wiktionary+dictionary
--------------------------------------------------------------------------------
/run_wiwordik.bat:
--------------------------------------------------------------------------------
1 | cd wiwordik
2 | wiwordik.bat
3 | cd ..
4 | :: javafx -cp ./wiwordik/dist/wiwordik.jar;./common_wiki/lib/mysql-connector-java-5.1.7-bin.jar;./common_wiki/lib/sqlite-jdbc-3.6.17.1.jar;./common_wiki/dist/common_wiki.jar wiwordik.Main test git-cola 2
5 |
--------------------------------------------------------------------------------
/sql_procedures/hyponyms/cat_count.sql:
--------------------------------------------------------------------------------
1 | DELIMITER //
2 | DROP TABLE IF EXISTS cat_count;//
3 | CREATE TABLE cat_count (
4 | `page_id` INT(10) UNSIGNED NOT NULL COMMENT 'Category page identifier. Corresponds to page.page_id',
5 | `page_title` VARCHAR(255) NOT NULL COMMENT 'Category page title. Copy of page.page_title, see http://www.mediawiki.org/wiki/Page_table',
6 | `n_depth` TINYINT UNSIGNED NOT NULL COMMENT 'The depth of a node n is the length of the path from the root to the node. The root node is at depth zero.',
7 | `n_subcat` SMALLINT UNSIGNED NOT NULL COMMENT 'Number of direct sub-categories (childrens). It is zero for category-leaf.',
8 | `n_articles` MEDIUMINT UNSIGNED NOT NULL COMMENT 'Number of articles which have this category.',
9 |
10 | `n_hyponyms` MEDIUMINT UNSIGNED NOT NULL COMMENT 'n_subcat + n_articles + n_hyponyms_of_sub-categories',
11 | `ic` FLOAT NOT NULL DEFAULT -1 COMMENT 'Infromation content, -1 helps to avoid additional categories which are not covered by root category',
12 | UNIQUE KEY `page_id` (`page_id`),
13 | UNIQUE KEY `page_title` (`page_title`)
14 | )
15 | ENGINE = MYISAM
16 | COMMENT = 'Category hyponyms counter';//
17 |
18 |
19 | DROP TABLE IF EXISTS cat_parent_stack;//
20 | CREATE TABLE cat_parent_stack (
21 | `page_title` VARCHAR(255) NOT NULL COMMENT 'Copy of page.page_title, see http://www.mediawiki.org/wiki/Page_table',
22 | `n_depth` TINYINT UNSIGNED NOT NULL COMMENT 'The depth of a node n is the length of the path from the root to the node. The root node is at depth zero.',
23 | UNIQUE KEY `page_title` (`page_title`)
24 | )
25 | ENGINE = MYISAM
26 | COMMENT = 'Temporary table of categories from root to current category. It is used to skip cycles of categories.';//
27 |
28 |
29 | DROP TABLE IF EXISTS cat_cycles;//
30 | CREATE TABLE cat_cycles (
31 | `concat_titles` VARCHAR(255) NOT NULL COMMENT 'List of category titles which forms a cycle'
32 | )
33 | ENGINE = MYISAM
34 | COMMENT = 'List of categories which forms cycles.';//
35 |
--------------------------------------------------------------------------------
/sql_procedures/hyponyms/hyponyms_test.sql:
--------------------------------------------------------------------------------
1 | == test enwiki ==
2 | CALL hyponyms('Network_flow')//
3 |
4 | == test simplewiki ==
5 | INSERT INTO cat_count (page_id,page_title) (SELECT page_id,page_title FROM page WHERE page_namespace=14 AND (page_title='Websites' OR page_title='Wikimedia' OR page_title='Wikis'));
6 | INSERT INTO cat_count (page_id,page_title) (SELECT page_id,page_title FROM page WHERE page_namespace=14 AND (page_title='Websites' OR page_title='Wikimedia' OR page_title='Wikis' OR page_title='Internet'));
7 |
8 | INSERT INTO cat_count (page_id,page_title) (SELECT page_id,page_title FROM page WHERE page_namespace=14 AND (page_title='Kings_of_Urartu' OR page_title='Monarchs_of_Armenia'));
9 |
10 | UPDATE cat_count SET n_depth=1 WHERE page_id=5498;
11 |
12 | -- test 1: Computer and Keyboard --
13 | -- Computers Computer_science Computing Writing_tools Tools
14 | Category:Everyday life -> Architecture -> Construction -> Tools
15 | Category:Everyday life -> Tools
16 |
17 | Category:Everyday life -> Learning -> Skills -> Tools
18 | Category:Everyday life -> Tools
19 |
20 | 1.
21 | DELETE FROM cat_count//
22 | 2.
23 | INSERT INTO cat_count (page_id,page_title) (SELECT page_id,page_title FROM page WHERE page_namespace=14 AND page_title IN ('Computers', 'Computer_science', 'Computing', 'Writing_tools', 'Tools', 'Appliances', 'Skills'))//
24 | 3.
25 | CALL hyponyms('Writing_tools')//
26 | CALL hyponyms('Tools')//
27 | CALL hyponyms('Skills')//
28 | CALL hyponyms('Learning')//
29 | CALL hyponyms('Everyday_life')//
30 |
31 | CALL hyponyms('Main_page')//
32 |
33 | 4.
34 | SELECT * FROM cat_count WHERE page_title IN ('Computers', 'Computer_science', 'Computing', 'Writing_tools', 'Tools', 'Appliances', 'Skills')//
35 | SELECT * FROM cat_count WHERE page_title IN ('Computers', 'Computer_science', 'Computing', 'Writing_tools', 'Tools', 'Appliances', 'Skills', 'Learning') ORDER BY n_hyponyms DESC//
36 |
--------------------------------------------------------------------------------
/sql_procedures/hyponyms/recalculate_ic.sql:
--------------------------------------------------------------------------------
1 | /** test in simplewiki: CALL recalculate_ic(426077); */
2 | DROP PROCEDURE IF EXISTS recalculate_ic//
3 | CREATE PROCEDURE recalculate_ic (
4 | IN category_size INT(10) /** Number of passed categories and articles */
5 | )
6 | COMMENT 'Recalculate IC'
7 | proc:
8 | BEGIN
9 | DECLARE done, error BOOL DEFAULT FALSE;
10 | DECLARE cur_hyponyms MEDIUMINT UNSIGNED;
11 | DECLARE cur_ic FLOAT;
12 | DECLARE cur_title VARCHAR(255);
13 | DECLARE LOG_CATEGORY_SIZE FLOAT;
14 |
15 | DECLARE cur
16 | CURSOR FOR
17 | SELECT n_hyponyms, page_title FROM cat_count;
18 | DECLARE
19 | CONTINUE HANDLER FOR
20 | SQLSTATE '02000'
21 | SET done = TRUE;
22 |
23 |
24 | SET LOG_CATEGORY_SIZE = LOG(category_size);
25 |
26 | OPEN cur;
27 | IF error THEN SELECT 'ERROR OPEN CURSOR failed in PROCEDURE recalculate_ic'; LEAVE proc; END IF;
28 |
29 | myLoop: LOOP
30 | FETCH cur INTO cur_hyponyms, cur_title;
31 | IF done THEN
32 | CLOSE cur;
33 | LEAVE myLoop;
34 | END IF;
35 |
36 | IF cur_hyponyms > 0 THEN
37 | /** if 0 hyponyms then ic = -1, remain it */
38 | /** information content of the category*/
39 | SET cur_ic = 1 - (LOG(cur_hyponyms + 1)) / LOG_CATEGORY_SIZE;
40 |
41 | UPDATE cat_count SET
42 | ic=cur_ic
43 | WHERE page_title=cur_title;
44 | END IF;
45 | END LOOP;
46 | END; //
47 |
--------------------------------------------------------------------------------
/wigraph/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=67a11d04
2 | build.xml.script.CRC32=52afaaea
3 | build.xml.stylesheet.CRC32=958a1d3e
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=67a11d04
7 | nbproject/build-impl.xml.script.CRC32=94352124
8 | nbproject/build-impl.xml.stylesheet.CRC32=65b8de21
9 |
--------------------------------------------------------------------------------
/wigraph/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | wigraph
7 | 1.6.5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | common_wiki
18 | jar
19 |
20 | jar
21 | clean
22 | jar
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wigraph/src/wigraph/DistanceData.java:
--------------------------------------------------------------------------------
1 | /* DistanceData.java - distance data storage.
2 | *
3 | * Copyright (c) 2009 Andrew Krizhanovsky
4 | * Distributed under GNU Public License.
5 | */
6 |
7 | package wigraph;
8 |
9 | /** Distance data storage
10 | */
11 | public class DistanceData {
12 |
13 | public float average;
14 | public float min;
15 | public float max;
16 |
17 | DistanceData(float _average,float _min,float _max) {
18 | average = _average;
19 | min = _min;
20 | max = _max;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/wigraph/src/wigraph/experiment/WordSim.java:
--------------------------------------------------------------------------------
1 | /*
2 | * WordSim.java - words similarity data object. calculator.
3 | *
4 | * Copyright (c) 2005-2009 Andrew Krizhanovsky
5 | * Distributed under GNU Public License.
6 | */
7 |
8 | package wigraph.experiment;
9 |
10 | /**
11 | * Words similarity object constructor used for
12 | * "The WordSimilarity-353 Test Collection".
13 | */
14 | public class WordSim {
15 |
16 | /** First word in the pair */
17 | String word1;
18 |
19 | /** Second word in the pair */
20 | String word2;
21 |
22 | /** Similarity (human) */
23 | float sim;
24 |
25 | public WordSim(String word1, String word2, float sim) {
26 | this.word1 = word1;
27 | this.word2 = word2;
28 | this.sim = sim;
29 | }
30 | }
--------------------------------------------------------------------------------
/wiki/MRDQuote.wiki:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/MRDQuote.wiki
--------------------------------------------------------------------------------
/wiki/wiwordik.attach/db_scheme/MRDW_framework_external_applications.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/wiwordik.attach/db_scheme/MRDW_framework_external_applications.png
--------------------------------------------------------------------------------
/wiki/wiwordik.attach/db_scheme/quote_tables.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/wiwordik.attach/db_scheme/quote_tables.png
--------------------------------------------------------------------------------
/wiki/wiwordik.attach/fi_balalaika_0.03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/wiwordik.attach/fi_balalaika_0.03.png
--------------------------------------------------------------------------------
/wiki/wiwordik.attach/friendly_dollar_0.01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/wiwordik.attach/friendly_dollar_0.01.jpg
--------------------------------------------------------------------------------
/wiki/wiwordik.attach/wikipedia_pratsuvati_0.01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiki/wiwordik.attach/wikipedia_pratsuvati_0.01.png
--------------------------------------------------------------------------------
/wikidf/doc/database_layout.txt:
--------------------------------------------------------------------------------
1 | The layout of the index of Wikipedia database (WikIDF database).
2 |
3 |
4 | table term - terms found in wiki-texts
5 | term_id - uniquely identifying primary key;
6 | lemma - the word's lemma (term), unique;
7 | doc_freq - document's frequency, number of documents where
8 | the term appears.
9 | NEW!!!
10 | corpus_freq - frequency of the term in the corpus
11 |
12 |
13 | table page - titles of wiki articles
14 | page_id - uniquely identifying primary key;
15 | page_title - copy from MediaWiki page.page_title,
16 | see http://www.mediawiki.org/wiki/Page_table
17 | NEW!!!
18 | word_count - number of words in the article
19 |
20 |
21 | table term_page - pages which contain the term (It may be constrained, e.g.
22 | first 100 articles)
23 | term_id
24 | page_id
25 | term_freq - term frequency in the document
26 |
27 | table related_page - list of related pages found by the algorithm, cache for
28 | Synarcher
29 | page_id
30 | related_titles - comma separated list of related pages' titles
31 |
32 |
33 | == References ==
34 |
35 | * List of keys for each table in WikIDF database see in the file:
36 | synarcher/kleinberg/docs/idf_db/wikidf_keys.txt
37 |
38 | * See Java classes which provides interface to work with this db in
39 | synarcher/kleinberg/src/wikipedia/sql_idf/*.java
40 |
41 | * See also rupostagger/wikidf/readme.txt
42 |
--------------------------------------------------------------------------------
/wikidf/doc/wikidf_keys.txt:
--------------------------------------------------------------------------------
1 | List of keys for each table in WikIDF database.
2 |
3 | See fields of tables in the file:
4 | synarcher/kleinberg/docs/idf_db/database_layout.txt
5 |
6 | 1) table term - terms found in wiki-texts
7 |
8 | PRIMARY KEY (`term_id`),
9 | UNIQUE KEY `lemma` (`lemma`)
10 |
11 | 2) table page - title of wiki articles
12 |
13 | PRIMARY KEY (`page_id`),
14 | KEY `page_title` (`page_title`)
15 |
16 | NEW!!!
17 | UNIQUE KEY `page_title` (`page_title`)
18 |
19 | 3) table term_page - pages which contain the term (It may be constrained, e.g.
20 | first 100 articles)
21 |
22 | KEY `term_id` (`term_id`)
23 | KEY `page_id` (`page_id`)
24 |
25 | 4) table related_page - list of related pages found by the algorithm, cache for
26 | Synarcher
27 |
28 | PRIMARY KEY (`rp_id`),
29 | UNIQUE KEY `page_id` (`page_id`)
30 |
31 |
--------------------------------------------------------------------------------
/wikidf/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=12e6eaa6
2 | build.xml.script.CRC32=7c765e61
3 | build.xml.stylesheet.CRC32=958a1d3e
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=5558efeb
7 | nbproject/build-impl.xml.script.CRC32=4ccf791b
8 | nbproject/build-impl.xml.stylesheet.CRC32=487672f9
9 | nbproject/profiler-build-impl.xml.data.CRC32=480148c8
10 | nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
11 | nbproject/profiler-build-impl.xml.stylesheet.CRC32=a5b6598e
12 |
--------------------------------------------------------------------------------
/wikidf/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | wikidf
7 | 1.6.5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | common_wiki
18 | jar
19 |
20 | jar
21 | clean
22 | jar
23 |
24 |
25 | hits_wiki
26 | jar
27 |
28 | jar
29 | clean
30 | jar
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/wikidf/src/wikidf/DictLanguage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * DictLanguage.java
3 | *
4 | * Copyright (c) 2005-2007 Andrew Krizhanovsky /aka at mail.iias.spb.su/
5 | * Distributed under GNU Public License.
6 | */
7 |
8 | package wikidf;
9 |
10 | /** Languages of dictionary for lemmatizing (at LemServer in RuPOSTagger)
11 | * ENGLISH
12 | * RUSSIAN
13 | * GERMAN
14 | *
15 | * See more in: Effective Java. Programming language Guide. J.Bloch.
16 | */
17 | public class DictLanguage {
18 |
19 | private final String lang;
20 |
21 | private DictLanguage(String lang) { this.lang = lang; }
22 |
23 | //public String toString() { return Integer.toString(number); }
24 | public String toString() { return lang; }
25 |
26 | public static final DictLanguage RUSSIAN = new DictLanguage("RUSSIAN");
27 |
28 | public static final DictLanguage ENGLISH = new DictLanguage("ENGLISH");
29 |
30 | public static final DictLanguage GERMAN = new DictLanguage("GERMAN");
31 |
32 |
33 | /** Gets DictLanguage by name */
34 | public static DictLanguage get(String lang) throws NullPointerException
35 | {
36 | if(lang.equalsIgnoreCase( RUSSIAN.toString())) {
37 | return RUSSIAN;
38 | } else if(lang.equalsIgnoreCase( ENGLISH.toString())) {
39 | return ENGLISH;
40 | } else if(lang.equalsIgnoreCase( GERMAN.toString())) {
41 | return GERMAN;
42 | } else {
43 | throw new NullPointerException("Null DictLanguage");
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/wikt_parser/doc/database_layout.txt:
--------------------------------------------------------------------------------
1 | The layout of the index of Wikipedia database (WikIDF database).
2 |
3 |
4 | table term - terms found in wiki-texts
5 | term_id - uniquely identifying primary key;
6 | lemma - the word's lemma (term), unique;
7 | doc_freq - document's frequency, number of documents where
8 | the term appears.
9 | NEW!!!
10 | corpus_freq - frequency of the term in the corpus
11 |
12 |
13 | table page - titles of wiki articles
14 | page_id - uniquely identifying primary key;
15 | page_title - copy from MediaWiki page.page_title,
16 | see http://www.mediawiki.org/wiki/Page_table
17 | NEW!!!
18 | word_count - number of words in the article
19 |
20 |
21 | table term_page - pages which contain the term (It may be constrained, e.g.
22 | first 100 articles)
23 | term_id
24 | page_id
25 | term_freq - term frequency in the document
26 |
27 | table related_page - list of related pages found by the algorithm, cache for
28 | Synarcher
29 | page_id
30 | related_titles - comma separated list of related pages' titles
31 |
32 |
33 | == References ==
34 |
35 | * List of keys for each table in WikIDF database see in the file:
36 | synarcher/kleinberg/docs/idf_db/wikidf_keys.txt
37 |
38 | * See Java classes which provides interface to work with this db in
39 | synarcher/kleinberg/src/wikipedia/sql_idf/*.java
40 |
41 | * See also rupostagger/wikidf/readme.txt
42 |
--------------------------------------------------------------------------------
/wikt_parser/doc/parsed/mean_semrel/mean_semrel_empty.mwb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/parsed/mean_semrel/mean_semrel_empty.mwb
--------------------------------------------------------------------------------
/wikt_parser/doc/run_wikt_parser.bat:
--------------------------------------------------------------------------------
1 | :: %1 language_code - language code of MySQL Wiktionary database to be parsed
2 | :: %2 n_start_from - number of records in database to start from
3 | :: e.g.: en 0, or ru 20000
4 |
5 | java -cp ./dist/wikt_parser.jar;./dist/lib/mysql-connector-java-8.0.11.jar;./dist/lib/common_wiki.jar -Xms1212m -Xmx1212m -Xmn16m -XX:+DisableExplicitGC wikt.parser.Main %1 %2 > enwikt20100824_parsed_06.log
6 |
7 | :: java -cp ./dist/wikt_parser.jar;./dist/lib/mysql-connector-java-8.0.11.jar;./dist/lib/common_wiki.jar -Xms1212m -Xmx1212m -Xmn16m -XX:+DisableExplicitGC -verbose:gc wikt.parser.Main %1 %2 > enwikt20100106_parsed_02.log
8 |
9 | ::javafx -cp ./dist/wiwordik.jar;./dist/lib/mysql-connector-java-8.0.11.jar;./dist/lib/sqlite-jdbc-3.6.17.1.jar;./dist/lib/common_wiki.jar wiwordik.Main
10 | :: javafx -verbose -cp ./dist/wiwordik.jar;./dist/lib/mysql-connector-java-8.0.11.jar;./dist/lib/sqlite-jdbc-3.6.17.1.jar;./dist/lib/common_wiki.jar wiwordik.Main
11 |
12 | :: javafx -cp ./wiwordik/dist/wiwordik.jar;./common_wiki/lib/mysql-connector-java-8.0.11.jar;./common_wiki/lib/sqlite-jdbc-3.6.17.1.jar;./common_wiki/dist/common_wiki.jar wiwordik.Main
13 |
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/Label_abstract_classes_hierarchy_IMG_20130205.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/Label_abstract_classes_hierarchy_IMG_20130205.jpg
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/mean_semrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/mean_semrel.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/mean_semrel/lang_wikt_parsed__wikt_mean_semrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/mean_semrel/lang_wikt_parsed__wikt_mean_semrel.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20080828.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20080828.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20080830.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20080830.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20090122.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20090122.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20090122_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20090122_2.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20090122_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20090122_3.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_20180631_image-meaning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_20180631_image-meaning.png
--------------------------------------------------------------------------------
/wikt_parser/doc/screenshots/wikt_parsed_empty_with_foreign_keys.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/screenshots/wikt_parsed_empty_with_foreign_keys.png
--------------------------------------------------------------------------------
/wikt_parser/doc/temp_todo_description.txt:
--------------------------------------------------------------------------------
1 | page table
2 |
3 | + boolean table.is_in_wiktionary;
4 | /** true, if the page_title exists in Wiktionary
5 | * false, if the page_title exists only as a [[|wikified word]] */
6 |
7 | meaning table
8 |
9 | Meaning includes:
10 | 1) a definition (preceded by "#"), or translation for foreign words;
11 | 2) semantic relations
12 | 3) translations
13 | ---
14 |
15 | wikipedia table
16 |
17 | Titles of related Wikipedia articles, "Wikipedia has articles on: ".
18 |
19 | It contains only titles of English Wikipedia for English Wiktionary, Russian (and etc.) links are skipped.
20 |
21 | Wikipedia title can be different from Wiktionary, e.g. War_(card_game) for "war".
22 |
--------------------------------------------------------------------------------
/wikt_parser/doc/wikidf_keys.txt:
--------------------------------------------------------------------------------
1 | List of keys for each table in WikIDF database.
2 |
3 | See fields of tables in the file:
4 | synarcher/kleinberg/docs/idf_db/database_layout.txt
5 |
6 | 1) table term - terms found in wiki-texts
7 |
8 | PRIMARY KEY (`term_id`),
9 | UNIQUE KEY `lemma` (`lemma`)
10 |
11 | 2) table page - title of wiki articles
12 |
13 | PRIMARY KEY (`page_id`),
14 | KEY `page_title` (`page_title`)
15 |
16 | NEW!!!
17 | UNIQUE KEY `page_title` (`page_title`)
18 |
19 | 3) table term_page - pages which contain the term (It may be constrained, e.g.
20 | first 100 articles)
21 |
22 | KEY `term_id` (`term_id`)
23 | KEY `page_id` (`page_id`)
24 |
25 | 4) table related_page - list of related pages found by the algorithm, cache for
26 | Synarcher
27 |
28 | PRIMARY KEY (`rp_id`),
29 | UNIQUE KEY `page_id` (`page_id`)
30 |
31 |
--------------------------------------------------------------------------------
/wikt_parser/doc/wikt_parsed_empty.mwb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/wikt_parsed_empty.mwb
--------------------------------------------------------------------------------
/wikt_parser/doc/wikt_parsed_empty_with_foreign_keys.mwb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/wikt_parsed_empty_with_foreign_keys.mwb
--------------------------------------------------------------------------------
/wikt_parser/doc/xml2sql/linux/xml2sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/xml2sql/linux/xml2sql
--------------------------------------------------------------------------------
/wikt_parser/doc/xml2sql/windows/xml2sql.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/doc/xml2sql/windows/xml2sql.exe
--------------------------------------------------------------------------------
/wikt_parser/lib/jericho-html-3.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/lib/jericho-html-3.3.jar
--------------------------------------------------------------------------------
/wikt_parser/lib/simmetrics_jar_v1_6_2_d07_02_07.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wikt_parser/lib/simmetrics_jar_v1_6_2_d07_02_07.jar
--------------------------------------------------------------------------------
/wikt_parser/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=a67329aa
2 | build.xml.script.CRC32=c231a1e7
3 | build.xml.stylesheet.CRC32=f85dc8f2@1.88.0.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=a67329aa
7 | nbproject/build-impl.xml.script.CRC32=f3d3eff6
8 | nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
9 | nbproject/profiler-build-impl.xml.data.CRC32=cc633ca7
10 | nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
11 | nbproject/profiler-build-impl.xml.stylesheet.CRC32=42cb6bcf
12 |
--------------------------------------------------------------------------------
/wikt_parser/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | wikt_parser
7 | 1.6.5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | common_wiki
18 | jar
19 |
20 | jar
21 | clean
22 | jar
23 |
24 |
25 | common_wiki_jdbc
26 | jar
27 |
28 | jar
29 | clean
30 | jar
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/wikt_parser/run_wikt_parser.sh:
--------------------------------------------------------------------------------
1 | #/bin/bash
2 | # %1 language_code - language code of MySQL Wiktionary database to be parsed
3 | # %2 n_start_from - number of records in database to start from
4 | # e.g.:
5 | # en 0
6 | # ru 20000
7 | #
8 | # Shell script (Linux)
9 | java -cp "dist/wikt_parser.jar:dist/lib/*" -Xms1212m -Xmx1212m -Xmn16m -XX:+DisableExplicitGC wikt.parser.Main $1 $2 > ruwikt20160210_parsed_05.log
10 | #
11 | # Script parameters (failed)
12 | # WIKLIBS='"wikt_parser.jar:dist/lib/*"'
13 | # JAVAOPTS="-Xms1212m -Xmx1212m -Xmn16m -XX:+DisableExplicitGC"
14 | # java -cp "$WIKLIBS" "$JAVAOPTS" wikt.parser.Main $1 $2 > ruwikt20160210_parsed_01.log
15 | #
16 | #
17 | #
18 | # ### .bat files (Windows)
19 | # ### java -cp ./dist/wikt_parser.jar;./dist/lib/mysql-connector-java-5.1.38-bin.jar;./dist/lib/common_wiki.jar;./dist/lib/common_wiki_jdbc.jar -Xms1212m -Xmx1212m -Xmn16m -XX:+DisableExplicitGC wikt.parser.Main %1 %2 > ruwikt20130508_parsed_07_.log
20 |
--------------------------------------------------------------------------------
/wikt_parser/src/wiktparsed/mean_semrel/parser/SemrelParser.java:
--------------------------------------------------------------------------------
1 | /* WiktParser.java - second main file for Wiktionary parsing.
2 | *
3 | * Copyright (c) 2008-2011 Andrew Krizhanovsky
4 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license.
5 | */
6 |
7 | package wiktparsed.mean_semrel.parser;
8 |
9 | import wiktparsed.mean_semrel.parser.sql.*;
10 |
11 | import wikokit.base.wikipedia.language.LanguageType;
12 |
13 | import wikokit.base.wikipedia.sql.Connect;
14 |
15 | //import wikt.sql.TLang;
16 | import wikokit.base.wikt.sql.TLang;
17 | import wikokit.base.wikt.sql.TPOS;
18 | import wikokit.base.wikt.sql.TRelationType;
19 |
20 |
21 | /** Top level functions for Wiktionary parsing.
22 | */
23 | public class SemrelParser {
24 | private static final boolean DEBUG = true;
25 |
26 | /* Recreate and fill the table wikt_mean_semrel.lang by data from LanguageType.java
27 | * Recreates tables mean_semrel_XX for each language code XX.
28 | */
29 | public static void clearDatabase (Connect wikt_parsed_conn, Connect mean_semrel_conn) {
30 |
31 | MSRLang.recreateTable(mean_semrel_conn);
32 | MSRLang.createFastMaps(mean_semrel_conn);
33 |
34 | TLang.createFastMaps(wikt_parsed_conn);
35 | TPOS.createFastMaps(wikt_parsed_conn);
36 | TRelationType.createFastMaps(wikt_parsed_conn);
37 |
38 | MSRMeanSemrelXX.generateTables(mean_semrel_conn);
39 | }
40 |
41 | public static void initWithoutClearDatabase (Connect wikt_parsed_conn, Connect mean_semrel_conn) {
42 | MSRLang.createFastMaps(mean_semrel_conn);
43 |
44 | TPOS.createFastMaps(wikt_parsed_conn);
45 | TRelationType.createFastMaps(wikt_parsed_conn);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/wiwordik/icons/Ekspert2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiwordik/icons/Ekspert2.jpg
--------------------------------------------------------------------------------
/wiwordik/icons/koala.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiwordik/icons/koala.ico
--------------------------------------------------------------------------------
/wiwordik/icons/koala.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiwordik/icons/koala.jpg
--------------------------------------------------------------------------------
/wiwordik/jnlp/wiwordik-en.jnlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | wiwordik-en
6 | Andrew Krizhanovsky
7 |
8 | Machine-readable Wiktionary (visualization of the parsed English Wiktionary database
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/wiwordik/jnlp/wiwordik-ru.jnlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | wiwordik-ru
5 | Andrew Krizhanovsky
6 |
7 | Machine-readable Wiktionary (visualization of the parsed Russian Wiktionary database).
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/wiwordik/jnlp/wiwordik-ru_test.jnlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | wiwordik-ru_test
7 | Andrew Krizhanovsky
8 |
9 | Machine-readable Wiktionary (visualization of the parsed Russian Wiktionary database).
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/wiwordik/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/wiwordik/mysql2sqlite/add_transactions.bat:
--------------------------------------------------------------------------------
1 | perl -w add_transactions.pl enwikt20100106_parsed_data.sql enwikt20100106_parsed_data_commits.sql
--------------------------------------------------------------------------------
/wiwordik/mysql2sqlite/mysql2sqlite.bat:
--------------------------------------------------------------------------------
1 | perl mysql2sqlite.pl wikt_parsed_structure_source.sql wikt_parsed_structure.sql
--------------------------------------------------------------------------------
/wiwordik/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=f8453f71
2 | build.xml.script.CRC32=4f170df7
3 | build.xml.stylesheet.CRC32=28e38971@1.50.1.46
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=0d88af49
7 | nbproject/build-impl.xml.script.CRC32=73123d67
8 | nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46
9 |
--------------------------------------------------------------------------------
/wiwordik/release_notes.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/wiwordik/release_notes.txt
--------------------------------------------------------------------------------
/wiwordik/sqlite/run_jarsigner.bat:
--------------------------------------------------------------------------------
1 | ::
2 | SET version=0.09
3 | SET sqlitefile=enwikt20111008
4 | ::SET sqlitefile=ruwikt20110521
5 | ::
6 | SET jarfile=wiwordik-%version%-%sqlitefile%.jar
7 | cd ..
8 | :: see http://www.lkn.ei.tum.de/arbeiten/faq/man/JAVA-tutorial/jar/basics/update.html
9 | ::::jar uf store/%jarfile% %sqlitefile%.sqlite
10 | ::jar uf store/%jarfile% sqlite/%sqlitefile%.sqlite
11 | ::
12 | :: see http://wiki.plexinfo.net/index.php?title=How_to_sign_JAR_files
13 | "C:\Program Files\Java\jdk1.7.0_02\bin\jarsigner" -keystore D:\all\docs\my_texts\social\root\jarsigner\myKeystore store/%jarfile% andrew_k
14 |
--------------------------------------------------------------------------------
/wiwordik/src/wiwordik/WConstants.java:
--------------------------------------------------------------------------------
1 | /* WConstants.fx - Constants and global variables used in Wiwordik.
2 | *
3 | * Copyright (c) 2011 Andrew Krizhanovsky
4 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license.
5 | */
6 |
7 | package wiwordik;
8 |
9 | import wikokit.base.wikipedia.language.LanguageType;
10 |
11 |
12 | public class WConstants {
13 |
14 | // GUI
15 |
16 | /** Width of word card. */
17 | public static int wordcard_width = 380; // old: wrapping_width
18 | public static int wordcard_min_width = 220;
19 |
20 | /** Width of word card. */
21 | public static int wordcard_height = 600;
22 | public static int wordcard_min_height = 120;
23 |
24 | public static Boolean DEBUGUI = false;
25 |
26 | /** Number of words visible in the list */
27 | public static int n_words_list = 31;
28 |
29 | /** Number of languages sorted by size (in dropdown list) */
30 | // public static int n_language_list_by_size = 200; // 100;
31 | // see LangChoice.fillChoiceBoxByLanguages
32 |
33 | // ===========
34 | // Wiktionary parsed database
35 | // ===========
36 |
37 | public static String wiwordik_version = "0.10";
38 |
39 | /** Skips #REDIRECT words if true. */
40 | public static boolean b_skip_redirects = false;
41 |
42 | //////////////////////////////
43 | // Release / publish parameters
44 |
45 | //var native_lang : LanguageType;
46 | public static LanguageType native_lang = LanguageType.ru;
47 | //public static LanguageType native_lang = LanguageType.en;
48 |
49 | /** If true, then SQLite database extracted from the .jar and stored
50 | * to the directory user.dir (Add .jar with SQLite database to the project).
51 | * If false, then SQLite database from the project local folder ./sqlite/
52 | */
53 | public static Boolean IS_RELEASE = false;
54 |
55 | /** true (SQLite), false (MySQL) */
56 | public static Boolean IS_SQLITE = false;
57 |
58 | // eo Parameters //
59 | //////////////////////////////
60 | }
61 |
--------------------------------------------------------------------------------
/wiwordik/src/wiwordik/search_window/WordCell.java:
--------------------------------------------------------------------------------
1 | /*
2 | */
3 | package wiwordik.search_window;
4 |
5 | import javafx.scene.control.ListCell;
6 | import javafx.scene.text.Text;
7 |
8 | /** Word item for the list of words, list of entries.
9 | */
10 | public class WordCell extends ListCell {
11 |
12 | Text text;
13 |
14 | @Override
15 | public void updateItem(String item, boolean empty) {
16 | super.updateItem(item, empty);
17 |
18 | text = new Text(item);
19 | setGraphic(text);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/wiwordik/src/wiwordik/word_card/TranslationCell.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package wiwordik.word_card;
6 |
7 | import javafx.scene.Node;
8 | import javafx.scene.control.ListCell;
9 | import javafx.scene.control.ListView;
10 | import javafx.scene.text.Text;
11 |
12 |
13 | /** Word item for the list of translations.
14 | */
15 | public class TranslationCell extends ListCell {
16 |
17 | // Text text;
18 |
19 | /*public TranslationCell(final ListView list) {
20 | //label = new Label();
21 | //setNode(label);
22 | }*/
23 |
24 | @Override
25 | public void updateItem(wiwordik.word_card.TranslationEntryItem item, boolean empty) {
26 | super.updateItem(item, empty);
27 |
28 | // text = new Text(item.text);
29 | // text = new Text("the very temp");
30 | if(null != item) {
31 | setText(item.getLangCodeTranslation());
32 | //Node n = item.hbox;
33 |
34 | //System.out.println("TranslationCell.updateItem(): lang_name="+item.lang_name+
35 | // "; lang_code=" + item.lang_code +
36 | // "; text="+item.text);
37 |
38 | //setGraphic(n);
39 | //setNode(n);
40 | }
41 | //setGraphic(item.hbox);
42 | //setNode(item.hbox);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/wiwordik/src/wiwordik/word_card/WCQuote.java:
--------------------------------------------------------------------------------
1 | /* WCQuote.java - A part of word card corresponds to quotations part
2 | * of a page (entry) in Wiktionary.
3 | *
4 | * Copyright (c) 2011 Andrew Krizhanovsky
5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license.
6 | */
7 |
8 | package wiwordik.word_card;
9 |
10 | import wikokit.base.wikt.sql.TMeaning;
11 | import wikokit.base.wikipedia.sql.Connect;
12 | import wikokit.base.wikt.sql.quote.TQuote;
13 |
14 | import javafx.scene.layout.VBox;
15 | import java.lang.*;
16 |
17 | /** One WCQuote contains all quotes (phrase/sentences) that illustrates one meaning
18 | * of Wiktionary word.
19 | *
20 | * @see wikt.word.WQuote
21 | */
22 | public class WCQuote {
23 |
24 | public VBox group = new VBox();
25 |
26 | /** Creates a part of card (parts of wiki pages) with list of quotes
27 | * related to one meaning (sense).
28 | *
29 | * @return true if there are any quotes for this meaning.
30 | **/
31 | public boolean create ( Connect conn,
32 | TMeaning _tmeaning
33 | )
34 | {
35 | group.setSpacing(5);
36 |
37 | // def rels : TRelation[] = TRelation.get(conn, _tmeaning);
38 | TQuote[] quotes = TQuote.get(conn, _tmeaning);
39 | if (quotes.length == 0)
40 | return false;
41 |
42 | String list;
43 | for(TQuote q : quotes) {
44 | // list = "{list}{q.getText()} || ";
45 |
46 | WCQuoteOneSentence _1quote = new WCQuoteOneSentence();
47 | _1quote.create(conn, q);
48 |
49 | // only visual part, skip logic
50 | group.getChildren().addAll(_1quote.group);
51 | }
52 |
53 | return true;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------