├── .gitignore ├── LICENSE-2.0.txt ├── README.md ├── TGWikiBrowser ├── build.xml ├── docs │ ├── Full Instructions.html │ ├── ReleaseNotes.txt │ └── quick_instructions.html ├── lib │ └── BrowserLauncher.jar ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── profiler-build-impl.xml │ ├── project.properties │ └── project.xml └── src │ ├── BrowserLauncher.java │ ├── TG-APACHE-LICENSE.txt │ ├── com │ └── touchgraph │ │ ├── graphlayout │ │ ├── Edge.java │ │ ├── GLPanel.java │ │ ├── GraphLayoutApplet.java │ │ ├── GraphListener.java │ │ ├── LocalityUtils.java │ │ ├── Node.java │ │ ├── TGAbstractLens.java │ │ ├── TGException.java │ │ ├── TGLayout.java │ │ ├── TGLensSet.java │ │ ├── TGPaintListener.java │ │ ├── TGPanel.java │ │ ├── TGPoint2D.java │ │ ├── TGScrollPane.java │ │ ├── graphelements │ │ │ ├── GESUtils.java │ │ │ ├── GraphEltSet.java │ │ │ ├── ImmutableGraphEltSet.java │ │ │ ├── Locality.java │ │ │ ├── TGForEachEdge.java │ │ │ ├── TGForEachNode.java │ │ │ ├── TGForEachNodePair.java │ │ │ ├── TGNodeQueue.java │ │ │ └── VisibleLocality.java │ │ └── interaction │ │ │ ├── DragAddUI.java │ │ │ ├── DragMultiselectUI.java │ │ │ ├── DragNodeUI.java │ │ │ ├── GLEditUI.java │ │ │ ├── GLNavigateUI.java │ │ │ ├── HVRotateDragUI.java │ │ │ ├── HVScroll.java │ │ │ ├── HyperScroll.java │ │ │ ├── LocalityScroll.java │ │ │ ├── RotateScroll.java │ │ │ ├── TGAbstractClickUI.java │ │ │ ├── TGAbstractDragUI.java │ │ │ ├── TGAbstractMouseMotionUI.java │ │ │ ├── TGAbstractMousePausedUI.java │ │ │ ├── TGSelfDeactivatingUI.java │ │ │ ├── TGUIManager.java │ │ │ ├── TGUserInterface.java │ │ │ └── ZoomScroll.java │ │ └── wikibrowser │ │ ├── SFSInputStream.java │ │ ├── SynArt.java │ │ ├── SynonymSearcher.java │ │ ├── TGWikiBrowser.java │ │ ├── WikiEdge.java │ │ ├── WikiNavigateUI.java │ │ ├── WikiNode.java │ │ ├── contextmenu │ │ └── ExpandCategories.java │ │ ├── panel │ │ ├── CategoryPanel.java │ │ ├── CategoryTableModel.java │ │ ├── ParametersPanel.java │ │ ├── ResultTableModel.java │ │ ├── ResultTablePanel.java │ │ ├── SynonymPanel.java │ │ └── db │ │ │ ├── DBLongTask.java │ │ │ ├── DBPanel.java │ │ │ └── SwingWorker.java │ │ └── parameter │ │ ├── ArticleParameters.java │ │ ├── BrowserParameters.java │ │ ├── Constants.java │ │ └── Parameters.java │ └── translation │ ├── MessagesBundle_en.properties │ ├── MessagesBundle_ru.properties │ ├── MessagesBundle_ru_edit.properties │ ├── messagesBundle_to_UTF-8.bat │ └── messagesBundle_to_UTF-8.sh ├── android ├── common_wiki_alink │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── proguard.cfg │ ├── project.properties │ └── res │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── layout │ │ └── main.xml │ │ └── values │ │ └── strings.xml ├── common_wiki_android │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── gen │ │ └── wikokit │ │ │ └── base │ │ │ └── R.java │ ├── lint.xml │ ├── proguard.cfg │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ ├── src │ │ └── wikokit │ │ │ └── base │ │ │ ├── wikipedia │ │ │ └── sql │ │ │ │ ├── Categorylinks.java │ │ │ │ ├── Connect.java │ │ │ │ ├── PageNamespace.java │ │ │ │ ├── PageTableBase.java │ │ │ │ ├── Statistics.java │ │ │ │ └── UtilSQL.java │ │ │ └── wikt │ │ │ ├── db │ │ │ ├── Decompressor.java │ │ │ ├── Downloader.java │ │ │ ├── FileUtil.java │ │ │ └── Zipper.java │ │ │ └── sql │ │ │ ├── TInflection.java │ │ │ ├── TLang.java │ │ │ ├── TLangPOS.java │ │ │ ├── TMeaning.java │ │ │ ├── TPOS.java │ │ │ ├── TPage.java │ │ │ ├── TPageInflection.java │ │ │ ├── TRelation.java │ │ │ ├── TRelationType.java │ │ │ ├── TTranslation.java │ │ │ ├── TTranslationEntry.java │ │ │ ├── TWikiText.java │ │ │ ├── TWikiTextWords.java │ │ │ ├── index │ │ │ ├── IndexForeign.java │ │ │ ├── IndexNative.java │ │ │ └── NativeRedLink.java │ │ │ ├── lang │ │ │ ├── LanguageNameComparator.java │ │ │ ├── LanguageSizeComparator.java │ │ │ └── LanguageSplitter.java │ │ │ └── quote │ │ │ ├── TQuotAuthor.java │ │ │ ├── TQuotPublisher.java │ │ │ ├── TQuotRef.java │ │ │ ├── TQuotSource.java │ │ │ ├── TQuotTranscription.java │ │ │ ├── TQuotTranslation.java │ │ │ ├── TQuotYear.java │ │ │ └── TQuote.java │ └── tests │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.ltk.core.refactoring.prefs │ │ ├── AndroidManifest.xml │ │ ├── gen │ │ └── wikokit │ │ │ └── base │ │ │ └── test │ │ │ └── R.java │ │ ├── lint.xml │ │ ├── proguard.cfg │ │ ├── project.properties │ │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ │ └── src │ │ └── wikokit │ │ └── base │ │ └── wikt │ │ └── sql │ │ ├── index │ │ └── test │ │ │ ├── IndexForeignTest.java │ │ │ └── IndexNativeTest.java │ │ ├── quote │ │ └── test │ │ │ ├── TQuotAuthorTest.java │ │ │ ├── TQuotPublisherTest.java │ │ │ ├── TQuotSourceTest.java │ │ │ └── TQuotYearTest.java │ │ └── test │ │ ├── TInflectionTest.java │ │ ├── TLangPOSTest.java │ │ ├── TLangTest.java │ │ ├── TMeaningTest.java │ │ ├── TPOSTest.java │ │ ├── TPageInflectionTest.java │ │ ├── TPageTest.java │ │ ├── TRelationTest.java │ │ ├── TRelationTypeTest.java │ │ ├── TWikiTextTest.java │ │ └── TWikiTextWordsTest.java ├── kiwidict │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── doc │ │ └── google.play.kiwidict │ │ │ ├── readme_de.txt │ │ │ ├── readme_en.txt │ │ │ └── readme_ru.txt │ ├── lint.xml │ ├── proguard.cfg │ ├── project.properties │ ├── release_notes.txt │ ├── release_notes_ru.txt │ ├── res │ │ ├── drawable-hdpi │ │ │ └── kiwi_ru.png │ │ ├── drawable-ldpi │ │ │ └── kiwi_ru.png │ │ ├── drawable-mdpi │ │ │ ├── fairytale_button_cancel.png │ │ │ ├── kiwi_ru.png │ │ │ └── magnifying_glsss2_crystal_project_viewmag.png │ │ ├── layout │ │ │ ├── download_install.xml │ │ │ ├── main.xml │ │ │ ├── word_card.xml │ │ │ ├── word_card_language.xml │ │ │ └── word_list_row.xml │ │ └── values │ │ │ ├── colors.xml │ │ │ └── strings.xml │ └── src │ │ └── wikokit │ │ └── kiwidict │ │ ├── DownloadAndInstallActivity.java │ │ ├── KWConstants.java │ │ ├── KiwidictActivity.java │ │ ├── db │ │ ├── ConcatenatingProgressThread.java │ │ ├── DataBaseHelper.java │ │ ├── DownloadProgressThread.java │ │ ├── JoinerFiles.java │ │ └── UnzippingProgressThread.java │ │ ├── lang │ │ ├── LangChoice.java │ │ ├── LangOnItemSelectedListener.java │ │ ├── LangSpinnerAdapter.java │ │ └── LanguageSpinner.java │ │ ├── search_window │ │ └── QueryTextString.java │ │ ├── util │ │ ├── GUI.java │ │ └── TipsTeapot.java │ │ ├── word_card │ │ ├── WCActivity.java │ │ ├── WCLanguageActivity.java │ │ ├── WCMeaning.java │ │ ├── WCPOSActivity.java │ │ ├── WCQuote.java │ │ ├── WCQuoteOneSentence.java │ │ ├── WCRelation.java │ │ └── WCRelationOneType.java │ │ └── wordlist │ │ ├── WordList.java │ │ ├── WordListArrayAdapter.java │ │ ├── WordListAsyncUpdater.java │ │ └── WordListAsyncUpdaterForeign.java └── magnetowordik │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── proguard.cfg │ ├── project.properties │ ├── readme.txt │ ├── release_notes.txt │ ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── layout │ │ └── main.xml │ └── values │ │ └── strings.xml │ └── src │ └── wordik │ └── magneto │ ├── AutoResizeTextView.java │ ├── GameLogic.java │ ├── JoinerFiles.java │ ├── MagnetowordikActivity.java │ ├── WordTextyView.java │ ├── constant │ └── Relation.java │ └── db │ ├── DataBaseHelper.java │ ├── MSRLang.java │ └── MSRMeanSemrelXX.java ├── common_wiki ├── build.xml ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── project.properties │ └── project.xml ├── src │ └── wikokit │ │ └── base │ │ ├── wikipedia │ │ ├── language │ │ │ ├── EncodingType.java │ │ │ ├── Encodings.java │ │ │ ├── LanguageType.java │ │ │ ├── LanguageTypeLocal.java │ │ │ └── WikimediaSisterProject.java │ │ ├── text │ │ │ ├── ImageParser.java │ │ │ ├── ReferenceParser.java │ │ │ ├── TableParser.java │ │ │ ├── WikiParser.java │ │ │ ├── XMLTag.java │ │ │ └── XMLTagsParser.java │ │ └── util │ │ │ ├── FileWriter.java │ │ │ ├── GraphMLFile.java │ │ │ ├── StringUtil.java │ │ │ ├── StringUtilRegular.java │ │ │ └── template │ │ │ ├── TemplateExtractor.java │ │ │ └── TemplateParser.java │ │ └── wikt │ │ ├── constant │ │ ├── FormOf.java │ │ ├── Image.java │ │ ├── Label.java │ │ ├── LabelCategory.java │ │ ├── LabelCategoryLocal.java │ │ ├── LabelLocal.java │ │ ├── POS.java │ │ ├── POSLocal.java │ │ ├── POSType.java │ │ ├── Relation.java │ │ ├── RelationLocal.java │ │ └── SoftRedirectType.java │ │ ├── multi │ │ ├── en │ │ │ ├── POSTemplateEn.java │ │ │ ├── WEtymologyEn.java │ │ │ ├── WLanguageEn.java │ │ │ ├── WMeaningEn.java │ │ │ ├── WPOSEn.java │ │ │ ├── WQuoteEn.java │ │ │ ├── WRedirectEn.java │ │ │ ├── WRelationEn.java │ │ │ ├── WTranslationEn.java │ │ │ ├── WTranslationEntryEn.java │ │ │ └── name │ │ │ │ ├── LabelEn.java │ │ │ │ └── POSEn.java │ │ └── ru │ │ │ ├── ImageParserRu.java │ │ │ ├── POSTemplateRu.java │ │ │ ├── WLanguageRu.java │ │ │ ├── WMeaningRu.java │ │ │ ├── WPOSRu.java │ │ │ ├── WQuoteRu.java │ │ │ ├── WRedirectRu.java │ │ │ ├── WRelationRu.java │ │ │ ├── WTranslationEntryRu.java │ │ │ ├── WTranslationRu.java │ │ │ ├── name │ │ │ ├── FormOfRu.java │ │ │ ├── LabelCategoryRu.java │ │ │ ├── LabelParamsRu.java │ │ │ ├── LabelRu.java │ │ │ ├── LanguageTypeRu.java │ │ │ ├── POSRu.java │ │ │ └── RelationRu.java │ │ │ └── quote │ │ │ ├── AuthorAndWikilink.java │ │ │ ├── TitleAndWikilink.java │ │ │ └── YearsRange.java │ │ ├── util │ │ ├── Definition.java │ │ ├── LabelsText.java │ │ ├── LabelsWikiText.java │ │ ├── LangText.java │ │ ├── POSText.java │ │ ├── WikiText.java │ │ └── WikiWord.java │ │ └── word │ │ ├── WLanguage.java │ │ ├── WMeaning.java │ │ ├── WPOS.java │ │ ├── WQuote.java │ │ ├── WRedirect.java │ │ ├── WRelation.java │ │ ├── WSynonyms.java │ │ ├── WTranslation.java │ │ ├── WTranslationEntry.java │ │ └── WordBase.java └── test │ └── wikokit │ └── base │ ├── wikipedia │ ├── language │ │ ├── EncodingsTest.java │ │ └── WikimediaSisterProjectTest.java │ ├── text │ │ ├── ImageParserTest.java │ │ ├── ReferenceParserTest.java │ │ ├── TableParserTest.java │ │ ├── WikiParserTest.java │ │ └── XMLTagsParserTest.java │ └── util │ │ ├── FileWriterTest.java │ │ ├── StringUtilRegularTest.java │ │ ├── StringUtilTest.java │ │ └── template │ │ ├── TemplateExtractorTest.java │ │ └── TemplateParserTest.java │ └── wikt │ ├── multi │ ├── en │ │ ├── WEtymologyEnTest.java │ │ ├── WLanguageEnTest.java │ │ ├── WMeaningEnTest.java │ │ ├── WPOSEnTest.java │ │ ├── WRelationEnTest.java │ │ ├── WTranslationEnTest.java │ │ └── WTranslationEntryEnTest.java │ └── ru │ │ ├── ImageParserRuTest.java │ │ ├── WLanguageRuTest.java │ │ ├── WMeaningRuTest.java │ │ ├── WPOSRuTest.java │ │ ├── WQuoteRuTest.java │ │ ├── WRedirectRuTest.java │ │ ├── WRelationRuTest.java │ │ ├── WTranslationEntryRuTest.java │ │ ├── WTranslationRuTest.java │ │ └── name │ │ ├── FormOfRuTest.java │ │ └── LabelRuTest.java │ ├── util │ ├── DefinitionTest.java │ ├── WikiTextTest.java │ └── WikiWordTest.java │ └── word │ └── WLanguageTest.java ├── common_wiki_jdbc ├── build.xml ├── lib │ └── sqlite-jdbc-3.7.2.jar ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── project.properties │ └── project.xml ├── src │ └── wikokit │ │ └── base │ │ ├── wikipedia │ │ ├── category │ │ │ └── CategoryHyponyms.java │ │ └── sql │ │ │ ├── Categorylinks.java │ │ │ ├── Connect.java │ │ │ ├── PageNamespace.java │ │ │ ├── PageTableBase.java │ │ │ ├── Statistics.java │ │ │ └── UtilSQL.java │ │ └── wikt │ │ ├── api │ │ ├── WTMeaning.java │ │ ├── WTRelation.java │ │ └── WTTranslation.java │ │ ├── mrd │ │ └── Keeper.java │ │ └── sql │ │ ├── TImage.java │ │ ├── TImageMeaning.java │ │ ├── TInflection.java │ │ ├── TLang.java │ │ ├── TLangPOS.java │ │ ├── TMeaning.java │ │ ├── TPOS.java │ │ ├── TPage.java │ │ ├── TPageInflection.java │ │ ├── TRelation.java │ │ ├── TRelationType.java │ │ ├── TTranslation.java │ │ ├── TTranslationEntry.java │ │ ├── TWikiText.java │ │ ├── TWikiTextWords.java │ │ ├── index │ │ ├── IndexForeign.java │ │ ├── IndexNative.java │ │ └── NativeRedLink.java │ │ ├── label │ │ ├── TLabel.java │ │ ├── TLabelCategory.java │ │ ├── TLabelMeaning.java │ │ └── TLabelRelation.java │ │ └── quote │ │ ├── TQuotAuthor.java │ │ ├── TQuotPublisher.java │ │ ├── TQuotRef.java │ │ ├── TQuotSource.java │ │ ├── TQuotTranscription.java │ │ ├── TQuotTranslation.java │ │ ├── TQuotYear.java │ │ └── TQuote.java └── test │ └── wikokit │ └── base │ ├── wikipedia │ ├── category │ │ └── CategoryHyponymsTest.java │ └── sql │ │ ├── CategorylinksTest.java │ │ ├── PageTableBaseTest.java │ │ └── StatisticsTest.java │ └── wikt │ ├── api │ ├── WTMeaningTest.java │ ├── WTTranslationTest.java │ └── WTTranslationTestEn.java │ └── sql │ ├── TInflectionTest.java │ ├── TLangPOSTest.java │ ├── TLangTest.java │ ├── TMeaningTest.java │ ├── TPOSTest.java │ ├── TPageInflectionTest.java │ ├── TPageTest.java │ ├── TRelationTest.java │ ├── TRelationTypeTest.java │ ├── TTranslationEntryTest.java │ ├── TTranslationTest.java │ ├── TWikiTextTest.java │ ├── TWikiTextWordsTest.java │ ├── index │ ├── IndexForeignTest.java │ └── IndexNativeTest.java │ └── quote │ ├── TQuotAuthorTest.java │ ├── TQuotPublisherTest.java │ ├── TQuotRefTest.java │ ├── TQuotSourceTest.java │ ├── TQuotTranscriptionTest.java │ ├── TQuotTranslationTest.java │ ├── TQuotYearTest.java │ └── TQuoteTest.java ├── gpl.txt ├── hits_wiki ├── docs │ ├── bugs.personal.txt │ ├── docbook │ │ ├── add_javawiki_to_mysql.sgm │ │ ├── download_wp_dumps_four_tables.sgm │ │ ├── html │ │ │ ├── figures │ │ │ │ ├── 03a_crop_search_parameters_robot.png │ │ │ │ ├── 04_results_table_and_graph_robot.png │ │ │ │ ├── chechnya_iwiki_eo.png │ │ │ │ ├── db_eo.png │ │ │ │ ├── enc_tab.png │ │ │ │ ├── orbita.ru.rate_circle.png │ │ │ │ └── quantity_en_categories_region.png │ │ │ └── index.html │ │ ├── index.xml │ │ ├── index.xml.new │ │ ├── index_ru.xml │ │ ├── project_synarcher.xml │ │ ├── project_synarcher_ru.xml │ │ ├── sh.index.xsltproc.sh │ │ ├── sh.project_synarcher.sh │ │ ├── sh.project_synarcher_ru.sh │ │ └── sh_ru_index.xsltproc.sh │ ├── experiments.personal.txt │ ├── ideas.kleinberg.personal.txt │ ├── settings.personal.txt │ ├── sourceforge.personal │ │ ├── abstract.txt │ │ └── mail_proj_desc.txt │ ├── sql.personal │ │ ├── sql_batch.bat │ │ ├── sql_batch.out │ │ ├── sql_batch.sql │ │ ├── sql_wikipedia.txt │ │ └── wikipedia_article_example.txt │ ├── src.Links.getAllLinks.personal │ │ ├── getAllLinks.txt │ │ └── getAllLinksFromNodes.txt │ └── todo.kleinberg.personal.txt ├── lib │ ├── commons-collections-3.1.jar │ ├── commons-collections-testframework-3.1.jar │ ├── commons-lang-2.1.jar │ ├── commons-logging-api.jar │ ├── commons-logging.jar │ └── jakarta-oro-2.0.8.jar ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── profiler-build-impl.xml │ ├── project.properties │ └── project.xml ├── src │ ├── rfc2229 │ │ ├── DictClient.java │ │ ├── MobyParser.java │ │ └── WordNetParser.java │ └── wikipedia │ │ ├── clustering │ │ ├── Cluster.java │ │ ├── ClusterCategory.java │ │ ├── Edge.java │ │ ├── HolderCluster.java │ │ └── Preprocessing.java │ │ ├── data │ │ ├── ArticleIdAndTitle.java │ │ ├── Redirect.java │ │ ├── RemovedArticles.java │ │ └── StringMap.java │ │ ├── disabled │ │ └── FreqLink.java │ │ ├── experiment │ │ ├── CatCount.java │ │ ├── Hyponyms.java │ │ ├── MetricSpearman.java │ │ ├── Valuer.java │ │ ├── WordSim.java │ │ └── WordSim353.java │ │ ├── kleinberg │ │ ├── Article.java │ │ ├── Authorities.java │ │ ├── Category.java │ │ ├── CategoryBlackList.java │ │ ├── CategorySet.java │ │ ├── DCEL.java │ │ ├── DumpToGraphViz.java │ │ ├── LinksBaseSet.java │ │ ├── Node.java │ │ ├── NodeType.java │ │ └── SessionHolder.java │ │ ├── sql │ │ ├── Links.java │ │ ├── PageTable.java │ │ └── maintenance │ │ │ ├── LinksOutExtractorText.java │ │ │ └── RefreshLinks.java │ │ ├── sql_idf │ │ ├── Page.java │ │ ├── RelatedPage.java │ │ ├── Term.java │ │ ├── TermPage.java │ │ └── WikIDFAPI.java │ │ └── util_rand │ │ └── RandShuffle.java └── test │ ├── rfc2229 │ ├── DictClientTest.java │ ├── MobyParserTest.java │ └── WordNetParserTest.java │ └── wikipedia │ ├── clustering │ ├── ClusterCategoryTest.java │ ├── CreateCategoryArticleGraph.java │ ├── EdgeTest.java │ └── PreprocessingTest.java │ ├── data │ ├── ArticleIdAndTitleTest.java │ ├── RedirectTest.java │ ├── RemovedArticlesTest.java │ └── StringMapTest.java │ ├── disabled │ └── LinksExtractorTest.java │ ├── experiment │ ├── HyponymsTest.java │ ├── MetricSpearmanTest.java │ └── ValuerTest.java │ ├── kleinberg │ ├── ArticleTest.java │ ├── AuthoritiesTest.java │ ├── CategoryBlackListTest.java │ ├── CategorySetTest.java │ ├── CategoryTest.java │ ├── DCELTest.java │ ├── DumpToGraphVizTest.java │ ├── LinksBaseSetTest.java │ └── SessionHolderTest.java │ ├── sql │ ├── LinksTest.java │ └── PageTableTest.java │ ├── sql_idf │ ├── PageTest.java │ ├── RelatedPageTest.java │ ├── TermPageTest.java │ ├── TermTest.java │ └── WikIDFAPITest.java │ └── util_rand │ └── RandShuffleTest.java ├── index.txt ├── jcfd ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── project.properties │ └── project.xml ├── src │ └── net │ │ └── zuckerfrei │ │ └── jcfd │ │ ├── AbstractDefinition.java │ │ ├── Command.java │ │ ├── Configuration.java │ │ ├── Database.java │ │ ├── DatabaseList.java │ │ ├── Definition.java │ │ ├── DefinitionFactory.java │ │ ├── DefinitionList.java │ │ ├── Dict.java │ │ ├── DictException.java │ │ ├── DictFactory.java │ │ ├── DictImpl.java │ │ ├── InvalidDatabaseException.java │ │ ├── InvalidResponseException.java │ │ ├── InvalidStrategyException.java │ │ ├── Match.java │ │ ├── MatchList.java │ │ ├── NoDatabasesException.java │ │ ├── NoStrategiesException.java │ │ ├── Response.java │ │ ├── Strategy.java │ │ ├── StrategyList.java │ │ └── simple │ │ ├── SimpleDefinition.java │ │ ├── SimpleDefinitionFactory.java │ │ ├── SimpleDict.java │ │ └── SimpleDictFactory.java └── test │ ├── Main.java │ └── net │ └── zuckerfrei │ └── jcfd │ ├── AllTests.java │ ├── ConfigurationFromSystemTest.java │ ├── ConfigurationTest.java │ ├── DefinitionListTest.java │ ├── DictTest.java │ ├── MatchListTest.java │ ├── MockBufferedReader.java │ ├── MockDataOutputStream.java │ ├── MockDefinition.java │ ├── MockDict.java │ ├── MockResourceBundle.java │ ├── ResponseTest.java │ └── simple │ ├── MockSimpleDict.java │ └── SimpleDictTest.java ├── media_commons └── image.py │ ├── doc │ └── statistics_ideas_etc.txt │ └── src │ ├── __init__.py │ ├── download_images_update_db.py │ └── lib │ ├── __init__.py │ └── create_thumb_url.py ├── piwidict ├── config.php ├── lib │ ├── header.php │ └── sql │ │ ├── tlang.php │ │ ├── tlang_pos.php │ │ ├── tpage.php │ │ ├── tpos.php │ │ └── trelation_type.php ├── readme.txt └── semantic_relations │ └── list_hypo.php ├── release_notes.txt ├── run_wiwordik.bat ├── sql_procedures └── hyponyms │ ├── cat_count.sql │ ├── hyponyms.sql │ ├── hyponyms_call.sql │ ├── hyponyms_cycles.sql │ ├── hyponyms_recur.sql │ ├── hyponyms_test.sql │ ├── readme_ic.txt │ └── recalculate_ic.sql ├── wigraph ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── project.properties │ └── project.xml ├── src │ └── wigraph │ │ ├── DistanceData.java │ │ ├── GraphCreator.java │ │ ├── LoadRelations.java │ │ ├── PathSearcher.java │ │ ├── SaveRelations.java │ │ ├── ShortestPathRelation.java │ │ └── experiment │ │ ├── ShortestPathEnViaRu353.java │ │ ├── Valuer.java │ │ ├── WordSim.java │ │ └── WordSim353.java └── test │ └── wigraph │ ├── GraphCreatorTest.java │ └── PathSearcherTest.java ├── wiki ├── MRDQuote.wiki ├── SQLExamples.wiki └── wiwordik.attach │ ├── db_scheme │ ├── MRDW_framework_external_applications.png │ └── quote_tables.png │ ├── fi_balalaika_0.03.png │ ├── friendly_dollar_0.01.jpg │ └── wikipedia_pratsuvati_0.01.png ├── wikidf ├── doc │ ├── database_layout.txt │ ├── idfwiki_empty.sql │ └── wikidf_keys.txt ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── profiler-build-impl.xml │ ├── project.properties │ └── project.xml └── src │ └── wikidf │ ├── DictLanguage.java │ ├── ExampleAPI.java │ ├── Keeper.java │ ├── PageTableAll.java │ ├── StandAloneAnnie.java │ ├── StandAloneRussianPOSTagger.java │ └── WikIDF.java ├── wikt_parser ├── build.xml ├── doc │ ├── database_layout.txt │ ├── parsed │ │ └── mean_semrel │ │ │ ├── mean_semrel_empty.mwb │ │ │ └── mean_semrel_empty.sql │ ├── redirect_in_pages-articles.xml2sql │ │ └── del_redirect_in_pages-articles_xml.pl │ ├── run_wikt_parser.bat │ ├── screenshots │ │ ├── Label_abstract_classes_hierarchy_IMG_20130205.jpg │ │ ├── mean_semrel.png │ │ ├── mean_semrel │ │ │ └── lang_wikt_parsed__wikt_mean_semrel.png │ │ ├── wikt_parsed_20080828.png │ │ ├── wikt_parsed_20080830.png │ │ ├── wikt_parsed_20090122.png │ │ ├── wikt_parsed_20090122_2.png │ │ ├── wikt_parsed_20090122_3.png │ │ ├── wikt_parsed_20180631_image-meaning.png │ │ └── wikt_parsed_empty_with_foreign_keys.png │ ├── temp_todo_description.txt │ ├── wikidf_keys.txt │ ├── wikt_parsed_empty.mwb │ ├── wikt_parsed_empty.sql │ ├── wikt_parsed_empty_with_foreign_keys.mwb │ ├── xml2sql │ │ ├── linux │ │ │ └── xml2sql │ │ └── windows │ │ │ └── xml2sql.exe │ └── xml2sql_helper │ │ └── xml2sql_helper.pl ├── lib │ ├── jericho-html-3.3.jar │ └── simmetrics_jar_v1_6_2_d07_02_07.jar ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── project.properties │ └── project.xml ├── run_wikt_parser.sh ├── src │ ├── wikt │ │ ├── parser │ │ │ ├── Main.java │ │ │ ├── PageTableAll.java │ │ │ └── WiktParser.java │ │ └── stat │ │ │ ├── LabelTableAll.java │ │ │ ├── POSAndPolysemyTableAll.java │ │ │ ├── ParsedDB.java │ │ │ ├── QuoteTableAll.java │ │ │ ├── QuoteYears.java │ │ │ ├── RelationTableAll.java │ │ │ ├── TranslationTableAll.java │ │ │ ├── WTStatisticsGoogleWiki.java │ │ │ └── printer │ │ │ ├── CommonPrinter.java │ │ │ └── POSAndPolysemyPrinter.java │ └── wiktparsed │ │ ├── mean_semrel │ │ └── parser │ │ │ ├── Main.java │ │ │ ├── PageWithSemrel.java │ │ │ ├── SemrelParser.java │ │ │ └── sql │ │ │ ├── MSRLang.java │ │ │ └── MSRMeanSemrelXX.java │ │ └── yarn │ │ ├── DefQuoteSynExporter.java │ │ └── DefQuoteSynExporterWordlist.java └── test │ └── wiktparsed │ └── mean_semrel │ └── parser │ └── sql │ ├── MSRLangTest.java │ └── MSRMeanSemrelXXTest.java └── wiwordik ├── build.xml ├── icons ├── Ekspert2.jpg ├── koala.ico └── koala.jpg ├── jnlp ├── wiwordik-en.jnlp ├── wiwordik-ru.jnlp └── wiwordik-ru_test.jnlp ├── manifest.mf ├── mysql2sqlite ├── add_transactions.bat ├── add_transactions.pl ├── mysql2sqlite.bat ├── mysql2sqlite.pl ├── wikt_parsed_structure_en.sql └── wikt_parsed_structure_ru.sql ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── jfx-impl.xml ├── project.properties └── project.xml ├── release_notes.txt ├── sqlite └── run_jarsigner.bat └── src └── wiwordik ├── Main.java ├── WConstants.java ├── search_window ├── DebugPanel.java ├── FilterMeanSemRelTrans.java ├── LangChoice.java ├── LangChoiceBox.java ├── QueryTextString.java ├── WordCell.java └── WordList.java ├── util └── TipsTeapot.java └── word_card ├── TranslationCell.java ├── TranslationEntryItem.java ├── WC.java ├── WCLanguage.java ├── WCMeaning.java ├── WCPOS.java ├── WCQuote.java ├── WCQuoteOneSentence.java ├── WCRelation.java └── WCTranslation.java /.gitignore: -------------------------------------------------------------------------------- 1 | /common_wiki/nbproject/private/ 2 | /wikt_parser/nbproject/private/ 3 | /common_wiki_jdbc/nbproject/private/ 4 | /common_wiki/build/ 5 | /common_wiki/dist/ 6 | /common_wiki_jdbc/build/ 7 | /common_wiki_jdbc/dist/ 8 | /wikt_parser/build/ 9 | /wikt_parser/dist/ 10 | *.bak 11 | -------------------------------------------------------------------------------- /TGWikiBrowser/lib/BrowserLauncher.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/TGWikiBrowser/lib/BrowserLauncher.jar -------------------------------------------------------------------------------- /TGWikiBrowser/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=155bd513 2 | build.xml.jax-ws.CRC32=749ccaa7 3 | build.xml.script.CRC32=466648f4 4 | build.xml.stylesheet.CRC32=28e38971@1.38.2.45 5 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 6 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 7 | nbproject/build-impl.xml.data.CRC32=155bd513 8 | nbproject/build-impl.xml.jax-ws.CRC32=749ccaa7 9 | nbproject/build-impl.xml.script.CRC32=731570ea 10 | nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45 11 | nbproject/profiler-build-impl.xml.data.CRC32=99196936 12 | nbproject/profiler-build-impl.xml.script.CRC32=abda56ed 13 | nbproject/profiler-build-impl.xml.stylesheet.CRC32=a5b6598e 14 | -------------------------------------------------------------------------------- /TGWikiBrowser/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | TGWikiBrowser 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 | -------------------------------------------------------------------------------- /TGWikiBrowser/src/translation/messagesBundle_to_UTF-8.bat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | @echo 'Converting MessagesBundle_ru to UTF-8'; 4 | native2ascii -encoding UTF-8 MessagesBundle_ru_edit.properties MessagesBundle_ru.properties 5 | -------------------------------------------------------------------------------- /TGWikiBrowser/src/translation/messagesBundle_to_UTF-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | echo 'Converting MessagesBundle_ru to UTF-8'; 4 | native2ascii -encoding UTF-8 MessagesBundle_ru_edit.properties MessagesBundle_ru.properties 5 | -------------------------------------------------------------------------------- /android/common_wiki_alink/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/common_wiki_alink/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | common_wiki_alink 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | src_common_wiki 36 | 2 37 | D:/all/projects/java/synonyms/wikokit/common_wiki/src 38 | 39 | 40 | src_link 41 | 2 42 | D:/all/projects/java/synonyms/wikokit/common_wiki/src 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/common_wiki_alink/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.5 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.5 12 | -------------------------------------------------------------------------------- /android/common_wiki_alink/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/common_wiki_alink/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /android/common_wiki_alink/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library=true 13 | -------------------------------------------------------------------------------- /android/common_wiki_alink/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_alink/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_alink/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_alink/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_alink/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_alink/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_alink/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /android/common_wiki_alink/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World! 5 | Common_wiki_alink 6 | 7 | -------------------------------------------------------------------------------- /android/common_wiki_android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/common_wiki_android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | common_wiki_android 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/common_wiki_android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.5 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.5 12 | -------------------------------------------------------------------------------- /android/common_wiki_android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /android/common_wiki_android/gen/wikokit/base/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package wikokit.base; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static int ic_launcher=0x7f020000; 15 | } 16 | public static final class layout { 17 | public static int main=0x7f030000; 18 | } 19 | public static final class string { 20 | public static int app_name=0x7f040001; 21 | public static int hello=0x7f040000; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/common_wiki_android/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/common_wiki_android/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /android/common_wiki_android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library=true 13 | android.library.reference.1=../common_wiki_alink 14 | -------------------------------------------------------------------------------- /android/common_wiki_android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /android/common_wiki_android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World! 5 | common_wiki_android 6 | 7 | -------------------------------------------------------------------------------- /android/common_wiki_android/src/wikokit/base/wikipedia/sql/UtilSQL.java: -------------------------------------------------------------------------------- 1 | 2 | package wikipedia.sql; 3 | 4 | import java.sql.*; 5 | 6 | /** Misc SQL routines. 7 | */ 8 | public class UtilSQL { 9 | 10 | /** Deletes all records from the table 'table_name', resets auto increment. 11 | * 12 | * DELETE FROM table_name; 13 | * ALTER TABLE table_name AUTO_INCREMENT = 0; 14 | */ 15 | public static void deleteAllRecordsResetAutoIncrement (Connect connect, String table_name) { 16 | 17 | Statement s = null; 18 | ResultSet rs= null; 19 | 20 | try { 21 | s = connect.conn.createStatement (); 22 | s.addBatch("DELETE FROM "+ table_name +";"); 23 | s.addBatch("ALTER TABLE "+ table_name +" AUTO_INCREMENT = 1;"); 24 | s.executeBatch(); 25 | 26 | } catch(SQLException ex) { 27 | System.err.println("SQLException (wikipedia.sql UtilSQL.java deleteAllRecordsResetAutoIncrement()):: table = "+ table_name +"; msg = " + ex.getMessage()); 28 | } finally { 29 | if (rs != null) { try { rs.close(); } catch (SQLException sqlEx) { } rs = null; } 30 | if (s != null) { try { s.close(); } catch (SQLException sqlEx) { } s = null; } 31 | } 32 | } 33 | 34 | 35 | public static void dropTable (Connect connect, String table_name) 36 | { 37 | if(null == connect) 38 | return; 39 | 40 | StringBuffer str_sql = new StringBuffer(); 41 | try { 42 | Statement s = connect.conn.createStatement (); 43 | try { 44 | str_sql.append("DROP TABLE IF EXISTS `"+ table_name + "`"); 45 | s.execute(str_sql.toString()); 46 | } finally { 47 | s.close(); 48 | } 49 | } catch(SQLException ex) { 50 | System.err.println("SQLException (MSRMeanSemrelXX.dropTable()): sql='" + str_sql + "' " + ex.getMessage()); 51 | } 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /android/common_wiki_android/src/wikokit/base/wikt/db/Decompressor.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.db; 2 | 3 | import android.util.Log; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.FileOutputStream; 7 | import java.util.zip.ZipEntry; 8 | import java.util.zip.ZipInputStream; 9 | 10 | /** Decompress ziped file. 11 | * 12 | * @see http://www.jondev.net/articles/Unzipping_Files_with_Android_%28Programmatically%29 13 | */ 14 | public class Decompressor { 15 | private String _zipFile; 16 | private String _location; 17 | 18 | public Decompressor(String zipFile, String location) { 19 | _zipFile = zipFile; 20 | _location = location; 21 | 22 | _dirChecker(""); 23 | } 24 | 25 | public void unzip() { 26 | try { 27 | FileInputStream fin = new FileInputStream(_zipFile); 28 | ZipInputStream zin = new ZipInputStream(fin); 29 | ZipEntry ze = null; 30 | while ((ze = zin.getNextEntry()) != null) { 31 | Log.v("Decompress", "Unzipping " + ze.getName()); 32 | 33 | if(ze.isDirectory()) { 34 | _dirChecker(ze.getName()); 35 | } else { 36 | FileOutputStream fout = new FileOutputStream(_location + ze.getName()); 37 | for (int c = zin.read(); c != -1; c = zin.read()) { 38 | fout.write(c); 39 | } 40 | 41 | zin.closeEntry(); 42 | fout.close(); 43 | } 44 | 45 | } 46 | zin.close(); 47 | } catch(Exception e) { 48 | Log.e("Decompress", "unzip", e); 49 | } 50 | 51 | } 52 | 53 | private void _dirChecker(String dir) { 54 | File f = new File(_location + dir); 55 | 56 | if(!f.isDirectory()) { 57 | f.mkdirs(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /android/common_wiki_android/src/wikokit/base/wikt/sql/index/NativeRedLink.java: -------------------------------------------------------------------------------- 1 | /* NativeRedLink.java - SQL operations with the table 'native_red_link' 2 | * in Wiktionary parsed database. 3 | * 4 | * Copyright (c) 2009 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | 8 | package wikt.sql.index; 9 | 10 | /** The table 'native_red_link' - list of red link words (without articles) 11 | * in native language, which were found in other WT articles in native language 12 | * (table in Wiktionary parsed database). 13 | */ 14 | public class NativeRedLink { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /android/common_wiki_android/src/wikokit/base/wikt/sql/lang/LanguageNameComparator.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.lang; 2 | 3 | import java.util.Comparator; 4 | 5 | import wikokit.base.wikt.sql.TLang; 6 | 7 | 8 | /** Sorts languages by size, i.e. by the number of POS, descending order. */ 9 | public class LanguageNameComparator implements Comparator { 10 | 11 | public int compare(TLang a, TLang b) { 12 | String a1 = a.getLanguage().getName(); 13 | String b1 = b.getLanguage().getName(); 14 | 15 | return a1.compareTo(b1); 16 | //System.out.println("LanguageSizeComparator: a="+a + "; b="+b+"; a.getNumberPOS()="+a.getNumberPOS()+"; b.getNumberPOS()="+b.getNumberPOS()); 17 | } 18 | } -------------------------------------------------------------------------------- /android/common_wiki_android/src/wikokit/base/wikt/sql/lang/LanguageSizeComparator.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.lang; 2 | 3 | import java.util.Comparator; 4 | 5 | import wikokit.base.wikt.sql.TLang; 6 | 7 | public /** Sorts languages by size, i.e. by the number of POS, descending order. */ 8 | class LanguageSizeComparator implements Comparator { 9 | 10 | public int compare(TLang a, TLang b) { 11 | int a1 = a.getNumberPOS(); 12 | int b1 = b.getNumberPOS(); 13 | 14 | //System.out.println("LanguageSizeComparator: a="+a + "; b="+b+"; a.getNumberPOS()="+a.getNumberPOS()+"; b.getNumberPOS()="+b.getNumberPOS()); 15 | if (a1 > b1) { 16 | return -1; 17 | } else { 18 | if(a1 < b1) { 19 | return 1; 20 | } else { 21 | return 0; 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /android/common_wiki_android/tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | common_wiki_android_test 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Jan 25 16:18:38 MSK 2012 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.5 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.5 13 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | #Wed Jan 25 16:18:38 MSK 2012 2 | eclipse.preferences.version=1 3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 4 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 12 | 13 | 16 | 17 | 18 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/gen/wikokit/base/test/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package wikokit.base.test; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int ic_launcher=0x7f020000; 15 | } 16 | public static final class layout { 17 | public static final int main=0x7f030000; 18 | } 19 | public static final class string { 20 | public static final int app_name=0x7f040001; 21 | public static final int hello=0x7f040000; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=.. 13 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/tests/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/tests/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/tests/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/tests/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/common_wiki_android/tests/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/common_wiki_android/tests/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World! 5 | Common_wiki_android_testTest 6 | 7 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/src/wikokit/base/wikt/sql/quote/test/TQuotSourceTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.quote.test; 2 | 3 | import wikokit.base.wikipedia.language.LanguageType; 4 | import wikokit.base.wikipedia.sql.Connect; 5 | import wikokit.base.wikt.sql.TLang; 6 | import wikokit.base.wikt.sql.TPOS; 7 | import wikokit.base.wikt.sql.quote.TQuotSource; 8 | import android.content.Context; 9 | import android.database.sqlite.SQLiteDatabase; 10 | import junit.framework.TestCase; 11 | 12 | public class TQuotSourceTest extends TestCase { 13 | 14 | public Context context = null; 15 | Connect ruwikt_conn; 16 | SQLiteDatabase db; 17 | 18 | protected void setUp() throws Exception { 19 | super.setUp(); 20 | ruwikt_conn = new Connect(context, LanguageType.ru); 21 | ruwikt_conn.openDatabase(); 22 | db = ruwikt_conn.getDB(); 23 | TLang.createFastMaps(db); 24 | TPOS.createFastMaps (db); 25 | } 26 | 27 | protected void tearDown() throws Exception { 28 | super.tearDown(); 29 | ruwikt_conn.close(); 30 | } 31 | 32 | public void testGet() { 33 | // zero sources 34 | String _name = "bla-bla-bla"; 35 | TQuotSource s = TQuotSource.get (db, _name); 36 | assertNull(s); 37 | 38 | // there is quotation for this publisher 39 | _name = "Lib"; 40 | s = TQuotSource.get(db, _name); 41 | assertNotNull(s); 42 | assertEquals(_name, s.getText()); 43 | } 44 | 45 | public void testGetByID() { 46 | // zero 47 | int id = -1; 48 | TQuotSource s = TQuotSource.getByID(db, id); 49 | assertNull(s); 50 | 51 | // there is a publisher 52 | String _name = "Lib"; 53 | s = TQuotSource.get(db, _name); 54 | assertNotNull(s); 55 | 56 | TQuotSource result_by_id = TQuotSource.getByID(db, s.getID()); 57 | assertNotNull(result_by_id); 58 | assertEquals(_name, result_by_id.getText()); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/src/wikokit/base/wikt/sql/test/TInflectionTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.test; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import wikokit.base.wikipedia.language.LanguageType; 6 | import wikokit.base.wikipedia.sql.Connect; 7 | import wikokit.base.wikt.sql.TInflection; 8 | 9 | import junit.framework.TestCase; 10 | 11 | public class TInflectionTest extends TestCase { 12 | 13 | public Context context = null; 14 | Connect ruwikt_conn; 15 | 16 | protected void setUp() throws Exception { 17 | super.setUp(); 18 | ruwikt_conn = new Connect(context, LanguageType.ru); 19 | ruwikt_conn.openDatabase(); 20 | } 21 | 22 | protected void tearDown() throws Exception { 23 | super.tearDown(); 24 | ruwikt_conn.close(); 25 | } 26 | 27 | public void testGet() { 28 | System.out.println("get_ru"); 29 | SQLiteDatabase db = ruwikt_conn.getDB(); 30 | 31 | String inflected_form = "test_TInflection_insert_ru"; 32 | 33 | // let's not find unknown inflection 34 | TInflection p = TInflection.get(db, inflected_form); 35 | assertNull(p); 36 | 37 | // let's find existing inflection 38 | inflected_form = "bonvolu"; // in Russian Wiktionary 39 | TInflection p2 = TInflection.get(db, inflected_form); 40 | assertNotNull(p2); 41 | 42 | int freq = p2.getFreq(); 43 | assertTrue(freq > 0); 44 | } 45 | 46 | public void testGetByID() { 47 | SQLiteDatabase db = ruwikt_conn.getDB(); 48 | 49 | // let's find existing inflection 50 | String inflected_form = "bonvolu"; // in Russian Wiktionary 51 | TInflection p = TInflection.get(db, inflected_form); 52 | assertNotNull(p); 53 | 54 | TInflection p2 = TInflection.getByID(db, p.getID()); 55 | assertNotNull(p2); 56 | assertEquals(p.getID(), p2.getID()); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/src/wikokit/base/wikt/sql/test/TPOSTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.test; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import junit.framework.TestCase; 6 | 7 | import wikokit.base.wikipedia.language.LanguageType; 8 | import wikokit.base.wikipedia.sql.Connect; 9 | import wikokit.base.wikt.sql.*; 10 | import wikokit.base.wikt.constant.POS; 11 | 12 | public class TPOSTest extends TestCase { 13 | 14 | public Context context = null; 15 | Connect ruwikt_conn; 16 | 17 | protected void setUp() throws Exception { 18 | super.setUp(); 19 | ruwikt_conn = new Connect(context, LanguageType.ru); 20 | ruwikt_conn.openDatabase(); 21 | } 22 | 23 | protected void tearDown() throws Exception { 24 | super.tearDown(); 25 | ruwikt_conn.close(); 26 | } 27 | 28 | public void testGetID() { 29 | System.out.println("getID"); 30 | SQLiteDatabase db = ruwikt_conn.getDB(); 31 | 32 | // once upon a time: create Wiktionary parsed db 33 | // skip for SQLite: TPOS.recreateTable(ruwikt_parsed_conn); 34 | 35 | // once upon a time: use Wiktionary parsed db 36 | TPOS.createFastMaps(db); 37 | 38 | // and every usual day 39 | int noun_id = TPOS.getIDFast(POS.noun); 40 | 41 | TPOS tpos = TPOS.get(db, POS.noun); 42 | assertEquals(tpos.getID(), noun_id); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/src/wikokit/base/wikt/sql/test/TRelationTypeTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.test; 2 | 3 | import wikokit.base.wikipedia.language.LanguageType; 4 | import wikokit.base.wikipedia.sql.Connect; 5 | import wikokit.base.wikt.constant.Relation; 6 | import wikokit.base.wikt.sql.TLang; 7 | import wikokit.base.wikt.sql.TPOS; 8 | import wikokit.base.wikt.sql.TRelationType; 9 | import android.content.Context; 10 | import android.database.sqlite.SQLiteDatabase; 11 | import junit.framework.TestCase; 12 | 13 | public class TRelationTypeTest extends TestCase { 14 | 15 | public Context context = null; 16 | Connect ruwikt_conn; 17 | SQLiteDatabase db; 18 | 19 | protected void setUp() throws Exception { 20 | super.setUp(); 21 | 22 | ruwikt_conn = new Connect(context, LanguageType.ru); 23 | ruwikt_conn.openDatabase(); 24 | db = ruwikt_conn.getDB(); 25 | 26 | // once upon a time: use Wiktionary parsed db 27 | //TLang.createFastMaps(db); 28 | //TPOS.createFastMaps (db); 29 | TRelationType.createFastMaps(db); 30 | } 31 | 32 | protected void tearDown() throws Exception { 33 | super.tearDown(); 34 | ruwikt_conn.close(); 35 | } 36 | 37 | public void testGet() { 38 | 39 | int synonymy_id = TRelationType.getIDFast(Relation.synonymy); 40 | 41 | TRelationType rel_type = TRelationType.get(db, Relation.synonymy); 42 | assertEquals(rel_type.getID(), synonymy_id); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /android/common_wiki_android/tests/src/wikokit/base/wikt/sql/test/TWikiTextTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikt.sql.test; 2 | 3 | import wikokit.base.wikipedia.language.LanguageType; 4 | import wikokit.base.wikipedia.sql.Connect; 5 | import wikokit.base.wikt.sql.TWikiText; 6 | 7 | import android.content.Context; 8 | import android.database.sqlite.SQLiteDatabase; 9 | import junit.framework.TestCase; 10 | 11 | public class TWikiTextTest extends TestCase { 12 | 13 | public Context context = null; 14 | Connect ruwikt_conn; 15 | 16 | protected void setUp() throws Exception { 17 | super.setUp(); 18 | ruwikt_conn = new Connect(context, LanguageType.ru); 19 | ruwikt_conn.openDatabase(); 20 | } 21 | 22 | protected void tearDown() throws Exception { 23 | super.tearDown(); 24 | ruwikt_conn.close(); 25 | } 26 | 27 | public void testGetID() { 28 | System.out.println("getID_ru"); 29 | SQLiteDatabase db = ruwikt_conn.getDB(); 30 | 31 | String text = "pronouncing dictionary"; 32 | 33 | // insert page, get wiki_text.id 34 | TWikiText p = null, p2 = null; 35 | p = TWikiText.get(db, text); 36 | assertNotNull(p); 37 | assertTrue(p.getID() > 0); 38 | 39 | p2 = TWikiText.getByID(db, p.getID()); 40 | assertNotNull(p2); 41 | 42 | assertEquals(p.getID(), p2.getID()); 43 | assertEquals(p.getText(), p2.getText()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/kiwidict/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/kiwidict/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | kiwidict 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/kiwidict/doc/google.play.kiwidict/readme_de.txt: -------------------------------------------------------------------------------- 1 | KiwiDict offline Wörterbuch 2 | 3 | KiwiDict ist ein offline vielsprachiges Wörterbuch und Thesaurus, das nach Angaben des englischen Wikiwörterbuches gebildet ist. 4 | 5 | * Hier sind die Wörter aus 742 Sprachen vorgestellt. Die Artikel sind automatisch aus dem englischen Wikiwörterbuch herausgezogen (http://ru.wiktionary.org). 6 | * Das Programm ist kostenfrei, ohne Werbung, mit offener Quellkode. 7 | * Das Wörterbuch wird lokal auf die SD-Karte heruntergeladen (d.h. Wörterbuch funktioniert offline ohne Internet). 8 | * Die Suche nach einem Wort wird mithilfe der Joker-Symbole verwirklicht (% und _), im Falle, dass Sie die Rechtschreibung des Wortes nicht genau wissen. 9 | 10 | Aus dem englischen Wikiwörterbuch wird Folfendes herausgezogen: 11 | * die Sprache, 12 | * die Wortart, 13 | * die Bedeutung/ die Erklärung, 14 | * semantische Verhältnisse (Synonyme, Antonyme,...) 15 | 16 | Beim ersten Start des Programms wird ein enormesWörterbuch automatisch heruntergeladen und angeschlossen. 17 | 18 | Es gibt ein selbständiges Anschlissen des Wörterbuches zur Auswahl. Sie müssen ein folgendes File herunterladen 19 | http://code.google.com/p/wikokit/downloads/detail?name=enwikt20111008_android_sqlite.7z und im Direkory /kiwidict/ der SD-Karte auspacken. Jetzt können Sie das Programm starten. 20 | 21 | Ich widme mein Programm Natascha. 22 | 23 | KiwiDict ist ein mit offener Quellkode Programm: http://code.google.com/p/wikokit/ 24 | 25 | Ich danke den Autoren von Wiktionary für die mühsame Arbeit bei der Erschaffung des Wörterbuches. Wiktionary ist das beste Wörterbuch. -------------------------------------------------------------------------------- /android/kiwidict/doc/google.play.kiwidict/readme_en.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/doc/google.play.kiwidict/readme_en.txt -------------------------------------------------------------------------------- /android/kiwidict/doc/google.play.kiwidict/readme_ru.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/doc/google.play.kiwidict/readme_ru.txt -------------------------------------------------------------------------------- /android/kiwidict/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/kiwidict/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /android/kiwidict/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../common_wiki_alink 13 | android.library.reference.2=../common_wiki_android 14 | -------------------------------------------------------------------------------- /android/kiwidict/release_notes.txt: -------------------------------------------------------------------------------- 1 | kiwidict 0.097 2012-??-?? 2 | 3 | 4 | 5 | kiwidict 0.096 2012-06-29 6 | 7 | - First release based on the English Wiktionary. 8 | 9 | kiwidict 0.095 2012-06-08 10 | 11 | - Added spinning wheel animations. 12 | 13 | kiwidict 0.094 2012-06-07 14 | 15 | - Added x-mark button - to delete all text in the input field. 16 | - Added search button (magnifying glass). 17 | - Bug fixed. The item "Russian language" in the dropdown menu works correctly now. 18 | 19 | 20 | kiwidict 0.093 2012-06-05 21 | 22 | - Fixed bug, now you can select "All languages" in dropdown menu. 23 | - Corrected cropped logo of sweet kiwi :) 24 | 25 | kiwidict 0.092 2012-06-02 26 | 27 | - Disabled "app debugging" :) 28 | 29 | kiwidict 0.091 2012-06-01 30 | 31 | - First version. 32 | - It is based on the Russian Wiktionary dump, as of May 21, 2011. 33 | - There are entries in 423 languages. 34 | - Added "www" link. It is a hyperlink to the corresponding article in the Wiktionary. 35 | - It was found by one user, that if you rotate screen, then the program will be restarted. Undocumented feature :( 36 | 37 | kiwidict 0.09 2011-10-12 38 | 39 | Added (from user's point of view): 40 | 41 | Added the beautiful icon of magnet. Thanks to commons.wikimedia.org! 42 | Added line which separates the game (centre of the screen) and results at the bottom of the screen. 43 | 44 | Added (from programmer's point of view) 45 | Nop 46 | -------------------------------------------------------------------------------- /android/kiwidict/release_notes_ru.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/release_notes_ru.txt -------------------------------------------------------------------------------- /android/kiwidict/res/drawable-hdpi/kiwi_ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/res/drawable-hdpi/kiwi_ru.png -------------------------------------------------------------------------------- /android/kiwidict/res/drawable-ldpi/kiwi_ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/res/drawable-ldpi/kiwi_ru.png -------------------------------------------------------------------------------- /android/kiwidict/res/drawable-mdpi/fairytale_button_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/res/drawable-mdpi/fairytale_button_cancel.png -------------------------------------------------------------------------------- /android/kiwidict/res/drawable-mdpi/kiwi_ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/res/drawable-mdpi/kiwi_ru.png -------------------------------------------------------------------------------- /android/kiwidict/res/drawable-mdpi/magnifying_glsss2_crystal_project_viewmag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/kiwidict/res/drawable-mdpi/magnifying_glsss2_crystal_project_viewmag.png -------------------------------------------------------------------------------- /android/kiwidict/res/layout/word_card_language.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 18 | 19 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/kiwidict/res/layout/word_list_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /android/kiwidict/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff8c00 4 | 5 | -------------------------------------------------------------------------------- /android/kiwidict/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Kiwidict 5 | Kiwidict-ru 6 | Dictionary database installation 7 | It is highly recommended to use available free wireless network (Wi-Fi) to avoid paying carrier data fees and download the dictionary file through it. 8 | The memory card has ??? MB of free space. 9 | \??? MB memory requirement. 10 | Download and install 11 | 12 | 13 | Source language 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/kiwidict/src/wikokit/kiwidict/db/JoinerFiles.java: -------------------------------------------------------------------------------- 1 | package wikokit.kiwidict.db; 2 | 3 | import java.io.File; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.OutputStream; 8 | import java.util.Arrays; 9 | 10 | import wikokit.kiwidict.KWConstants; 11 | 12 | import android.content.Context; 13 | import android.content.res.AssetManager; 14 | import android.util.Log; 15 | 16 | /** Joins splitted files into one file. 17 | * 18 | * @see http://stackoverflow.com/questions/2860157/load-files-bigger-than-1m-from-assets-folder 19 | */ 20 | public class JoinerFiles { 21 | 22 | 23 | /** Joins files "enwikt.N" (from assets folder) into out_db_file (e.g. "enwikt_mean_semrel_sqlite"). 24 | * 25 | * @param context 26 | * @param out_db_file 27 | * @throws IOException 28 | * 29 | * @see 30 | */ 31 | /* static public void joinDatabaseChunks(Context context, File out_db_file) throws IOException 32 | { 33 | AssetManager am = context.getAssets(); 34 | OutputStream os = new FileOutputStream(out_db_file); 35 | out_db_file.createNewFile(); 36 | byte []b = new byte[1024]; 37 | int i, r; 38 | String []in_files = am.list(""); 39 | Arrays.sort(in_files); 40 | for(i=1;i< KWConstants.MAX_NUMBER_DB_PARTS ;i++) 41 | { 42 | String fn = String.format("%s.%d", KWConstants.DB_ZIPFILE, i); 43 | //Log.d("debug", "fn=" + fn); 44 | 45 | if(Arrays.binarySearch(in_files, fn) < 0) 46 | break; 47 | //Log.d("debug", "fn=" + fn + "; yes"); 48 | InputStream is = am.open(fn); 49 | while((r = is.read(b)) != -1) 50 | os.write(b, 0, r); 51 | is.close(); 52 | } 53 | os.close(); 54 | }*/ 55 | } 56 | -------------------------------------------------------------------------------- /android/kiwidict/src/wikokit/kiwidict/lang/LangSpinnerAdapter.java: -------------------------------------------------------------------------------- 1 | package wikokit.kiwidict.lang; 2 | 3 | 4 | import wikokit.base.wikt.sql.lang.LanguageSplitter; 5 | import android.app.Activity; 6 | import android.widget.ArrayAdapter; 7 | 8 | public class LangSpinnerAdapter extends ArrayAdapter { 9 | 10 | private final Activity activity; 11 | private final String[] langs; 12 | private final LanguageSpinner lspinner; 13 | private final LanguageSplitter lsplitter; 14 | 15 | public LangSpinnerAdapter(Activity activity, int gui, String[] objects, LanguageSpinner lspinner) { 16 | 17 | super(activity, gui, objects); 18 | this.activity = activity; 19 | this.langs = objects; 20 | 21 | this.lspinner = lspinner; 22 | this.lsplitter = lspinner.getLanguageSplitter(); 23 | } 24 | 25 | /* Let's disable in drop down menu: "--- NNN < entries < NNNNN ---" */ 26 | public boolean isEnabled(int position) { 27 | if(position == 1 + lsplitter.getPart1Length() || 28 | position == lsplitter.getPart2Length()) 29 | return false; 30 | 31 | return true; 32 | } 33 | 34 | public boolean areAllItemsEnabled() { 35 | return false; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /android/kiwidict/src/wikokit/kiwidict/util/GUI.java: -------------------------------------------------------------------------------- 1 | package wikokit.kiwidict.util; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.res.Resources; 6 | import android.util.TypedValue; 7 | 8 | public class GUI { 9 | 10 | /** Converts pixels to Density-independent Pixels. 11 | * 12 | * @see http://stackoverflow.com/questions/4914039/margins-of-a-linearlayout-programmatically-with-dp 13 | */ 14 | public static int ConvertPixelsToDP (Activity context, int pixels) { 15 | 16 | float d = context.getResources().getDisplayMetrics().density; 17 | return (int)(pixels * d); 18 | } 19 | 20 | 21 | /** Converts Device Independent Pixels to pixels. 22 | * 23 | * @see http://stackoverflow.com/a/2406790/1173350 24 | */ 25 | public static int ConvertDPToPixels (Context context, int dp) { 26 | 27 | Resources r = context.getResources(); 28 | return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /android/magnetowordik/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/magnetowordik/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | magnetowordik 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/magnetowordik/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/magnetowordik/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /android/magnetowordik/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | -------------------------------------------------------------------------------- /android/magnetowordik/readme.txt: -------------------------------------------------------------------------------- 1 | magnetowordik 2 | 3 | This is a game, which helps to learn foreign words in many languages. You have to guess pairs of synonyms, or antonyms. In the bottom of the screen you see the total number of correct and wrong answers. 4 | 5 | This version contains words in 15 languages: English, German, Finnish, Translingual, French, Dutch, Italian, Spanish, Mandarin, Swedish, Russian, Esperanto, Romanian, Serbo-Croatian, Catalan. 6 | 7 | English Wiktionary is a data source. Words and semantic relations (small part in this version) was automatically extracted with the help of Wiktionary parser wikokit. See http://code.google.com/p/wikokit/ 8 | 9 | If you will find an error in synonyms, then, please, check the corresponding article in the English Wiktionary. If you correct the Wiktionary entry, then the next version of this game will contain correct synonyms entered by you. Thank you. 10 | 11 | Play the game, learn the language! 12 | 13 | -------------------------------------------------------------------------------- /android/magnetowordik/release_notes.txt: -------------------------------------------------------------------------------- 1 | magnetowordik 1.02 2011-??-?? 2 | 3 | Added (from user's point of view): 4 | Now there are 25 languages in the database of this game. These are the languages which have more than 1000 of synonyms + antonyms + hyperonyms + etc. in the English Wiktionary. 5 | 6 | Added button with the text "www". It is a hyperlink to the corresponding article in the Wiktionary. 7 | 8 | It was found by one player, that if you rotate screen, then 9 | the game will be restarted. Undocumented feature. 10 | 11 | 12 | 13 | magnetowordik 1.01 2011-10-12 14 | 15 | Added (from user's point of view): 16 | 17 | Added the beautiful icon of magnet. Thanks to commons.wikimedia.org! 18 | Added line which separates the game (centre of the screen) and results at the bottom of the screen. 19 | 20 | Added (from programmer's point of view) 21 | Nop 22 | -------------------------------------------------------------------------------- /android/magnetowordik/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/magnetowordik/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /android/magnetowordik/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/magnetowordik/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /android/magnetowordik/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/android/magnetowordik/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /android/magnetowordik/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | * 4 | Magnetowordik 5 | Word 1 6 | 7 | word_def 8 | Word 2 9 | Word 3 10 | word 11 | mark 12 | 13 | -------------------------------------------------------------------------------- /android/magnetowordik/src/wordik/magneto/JoinerFiles.java: -------------------------------------------------------------------------------- 1 | package wordik.magneto; 2 | 3 | import java.io.File; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.OutputStream; 8 | import java.util.Arrays; 9 | 10 | import android.content.Context; 11 | import android.content.res.AssetManager; 12 | import android.util.Log; 13 | 14 | /** Joins splitted files into one file. 15 | * 16 | * @see http://stackoverflow.com/questions/2860157/load-files-bigger-than-1m-from-assets-folder 17 | */ 18 | public class JoinerFiles { 19 | 20 | 21 | /** Joins files "enwikt.N" (from assets folder) into out_db_file (e.g. "enwikt_mean_semrel_sqlite"). 22 | * 23 | * @param context 24 | * @param out_db_file 25 | * @throws IOException 26 | * 27 | * @see 28 | */ 29 | static public void joinDatabaseChunks(Context context, File out_db_file) throws IOException 30 | { 31 | AssetManager am = context.getAssets(); 32 | OutputStream os = new FileOutputStream(out_db_file); 33 | out_db_file.createNewFile(); 34 | byte []b = new byte[1024]; 35 | int i, r; 36 | String []in_files = am.list(""); 37 | Arrays.sort(in_files); 38 | for(i=1;i<30;i++) 39 | { 40 | String fn = String.format("enwikt.%d", i); 41 | //Log.d("debug", "fn=" + fn); 42 | 43 | if(Arrays.binarySearch(in_files, fn) < 0) 44 | break; 45 | //Log.d("debug", "fn=" + fn + "; yes"); 46 | InputStream is = am.open(fn); 47 | while((r = is.read(b)) != -1) 48 | os.write(b, 0, r); 49 | is.close(); 50 | } 51 | os.close(); 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /android/magnetowordik/src/wordik/magneto/WordTextyView.java: -------------------------------------------------------------------------------- 1 | package wordik.magneto; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.View.OnClickListener; 7 | import android.widget.TextView; 8 | 9 | /** Clickable TextView. */ 10 | public class WordTextyView extends Activity implements OnClickListener { 11 | 12 | TextView t; 13 | private int r_id; 14 | 15 | public void WordTextyView(int _r_id) { 16 | r_id = _r_id; 17 | } 18 | 19 | @Override 20 | public void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.main); 23 | t = (TextView)findViewById(r_id); 24 | t.setOnClickListener(this); 25 | } 26 | 27 | public void onClick(View arg0) { 28 | t.setText("My text on click"); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /common_wiki/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=117f8f74 2 | build.xml.script.CRC32=ed266340 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=117f8f74 7 | nbproject/build-impl.xml.script.CRC32=03d7e9f4 8 | nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48 9 | -------------------------------------------------------------------------------- /common_wiki/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | common_wiki 7 | 1.6.5 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikipedia/language/LanguageTypeLocal.java: -------------------------------------------------------------------------------- 1 | /* LanguageTypeLocal.java - names of languages in some language. 2 | * 3 | * Copyright (c) 2010-2011 Andrew Krizhanovsky 4 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 5 | */ 6 | 7 | package wikokit.base.wikipedia.language; 8 | 9 | 10 | /** Names of languages in some language (e.g. Russian) 11 | * and the links to the LanguageType codes. 12 | */ 13 | public abstract class LanguageTypeLocal { 14 | 15 | /** Language name, e.g. "Russian" */ 16 | protected String name; 17 | 18 | /** LanguageType corresponding to this name, e.g. LanguageType.ru */ 19 | protected LanguageType type; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikipedia/util/GraphMLFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * GraphMLFile.java - store/load Wiki graph in GraphML format via JUNG module. 3 | * 4 | * Copyright (c) 2005-2007 Andrew Krizhanovsky /aka at mail.iias.spb.su/ 5 | * Distributed under GNU Public License. 6 | */ 7 | 8 | package wikokit.base.wikipedia.util; 9 | 10 | /** GraphML loader/writer. 11 | */ 12 | public class GraphMLFile { 13 | 14 | /** Creates a new instance of GraphMLFile */ 15 | // public GraphMLFile() { 16 | // } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/constant/FormOf.java: -------------------------------------------------------------------------------- 1 | /* FormOf.java - form-of templates functions. 2 | * 3 | * Copyright (c) 2013 Andrew Krizhanovsky 4 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 5 | */ 6 | package wikokit.base.wikt.constant; 7 | 8 | /** Form-of templates functions. 9 | * 10 | * @see http://en.wiktionary.org/wiki/Category:Form-of_templates 11 | */ 12 | public abstract class FormOf { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/constant/Image.java: -------------------------------------------------------------------------------- 1 | /* Image.java - picture in the Wiktionary entry related to some meaning of word, 2 | * filename and picture caption are contained in [[File:...]] or {{илл|}}. 3 | * 4 | * Copyright (c) 2017 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | package wikokit.base.wikt.constant; 8 | 9 | /** Image (picture) related to some definition (meaning). 10 | * 11 | * Filenames and captions of images could be presented in Wiktionary entry. 12 | */ 13 | public class Image { 14 | 15 | 16 | /** File name of image at Commons. One meaning has one (or zero) image. 17 | */ 18 | private String filename; 19 | 20 | /** Text of image caption. */ 21 | private String caption; 22 | 23 | /** Number of meaning could be presented. 24 | * -1 by default 25 | */ 26 | private int meaning_number; 27 | 28 | public Image(String filename, String caption) { 29 | // -1, that is meaning number is absent 30 | this(filename, caption, -1); 31 | } 32 | 33 | public Image(String filename, String caption, int meaning_number) { 34 | 35 | if(filename.length() == 0) 36 | System.out.println("Error in constructor Image::Image(): filename is empty!"); 37 | 38 | this.filename = filename; 39 | this.caption = caption; 40 | this.meaning_number = meaning_number; 41 | } 42 | 43 | /** Gets name of file at Commons. 44 | */ 45 | public String getFilename() { 46 | return filename; 47 | } 48 | 49 | /** Gets text caption of image. 50 | */ 51 | public String getCaption() { 52 | return caption; 53 | } 54 | 55 | /** Gets number of meaning related to this image. 56 | */ 57 | public int getMeaningNumber() { 58 | return meaning_number; 59 | } 60 | 61 | // if(null == params || params.length == 0) 62 | //return NULL_STRING_ARRAY; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/constant/LabelCategoryLocal.java: -------------------------------------------------------------------------------- 1 | /* LabelCategoryLocal.java - auxiliary class supporting categories of context 2 | * labels (templates) presented in the sections: definitions, Synonyms, 3 | * and Translations. 4 | * 5 | * Copyright (c) 2013 Andrew Krizhanovsky 6 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 7 | */ 8 | package wikokit.base.wikt.constant; 9 | 10 | /** Auxiliary class supporting interlinking categories of context labels 11 | * (templates) of English Wiktionary with other wiktionaries. 12 | * 13 | * Names of labels categories in some language (e.g. Russian) 14 | * and the links to the LabelCategory names. 15 | */ 16 | public class LabelCategoryLocal { 17 | 18 | /** Name of labels category, e.g. "Грамматические" (grammatical) in "Russian" */ 19 | protected String name; 20 | 21 | /** LabelCategory corresponding to this name, e.g. LabelCategory.grammatical */ 22 | protected LabelCategory category; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/constant/SoftRedirectType.java: -------------------------------------------------------------------------------- 1 | /* SoftRedirectType.java - list of types of soft redirects used in all wiktionaries. 2 | * 3 | * Copyright (c) 2009 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.constant; 8 | 9 | import java.util.Map; 10 | import java.util.HashMap; 11 | 12 | /** Names of types of soft redirects used in all wiktionaries. 13 | * 14 | * @see Wiktionary:Redirections and Help:Redirect in English Wiktionary 15 | * @see TPage.is_redirect - a hard redirect. 16 | */ 17 | public class SoftRedirectType { 18 | 19 | /** Name of a redirect type, e.g. SpellingError */ 20 | private final String name; 21 | 22 | @Override 23 | public String toString() { return name; } 24 | 25 | /* Set helps to check the presence of elements */ 26 | private static Map name2type = new HashMap(); 27 | 28 | private SoftRedirectType (String _name) { 29 | name = _name; 30 | name2type.put(_name, this); 31 | } 32 | 33 | /** Checks weather exists the type by its name. */ 34 | public static boolean has(String _name) { 35 | return name2type.containsKey(_name); 36 | } 37 | 38 | /** Gets a type by its name */ 39 | public static SoftRedirectType get(String _name) { 40 | return name2type.get(_name); 41 | } 42 | 43 | 44 | /** The types of soft redirects are: */ 45 | /*************************************/ 46 | 47 | /** It's not a redirect, it is the usual Wiktionary entry */ 48 | public static final SoftRedirectType None = new SoftRedirectType("None"); 49 | 50 | /** Wordform - soft redirect to correct spelling. */ 51 | public static final SoftRedirectType Wordform = new SoftRedirectType("Wordform"); 52 | 53 | /** Misspelling - soft redirect to correct spelling {{misspelling of|}} or {{wrongname|}}. */ 54 | public static final SoftRedirectType Misspelling = new SoftRedirectType("Misspelling"); 55 | } 56 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/multi/en/WQuoteEn.java: -------------------------------------------------------------------------------- 1 | /* WQuoteEn.java - corresponds to the phrase/sentence that illustrates a meaning 2 | * of a word in English Wiktionary. 3 | * 4 | * Copyright (c) 2011 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | 8 | package wikokit.base.wikt.multi.en; 9 | 10 | /** Phrase or sentence that illustrates a meaning of a word in Russian Wiktionary. 11 | */ 12 | public class WQuoteEn { 13 | 14 | 15 | /** Removes highlighted marks from a sentence. 16 | * Sentence with '''words'''. -> Sentence with words. 17 | */ 18 | public static String removeHighlightedMarksFromSentence(String str) 19 | { 20 | if(str.contains("'''")) 21 | return str.replace("'''", ""); 22 | 23 | return str; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/multi/en/WRedirectEn.java: -------------------------------------------------------------------------------- 1 | /* WRedirectEn.java - functions related to redirects in wiki and English Wiktionary. 2 | * 3 | * Copyright (c) 2010 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.multi.en; 8 | 9 | import java.util.regex.Pattern; 10 | import java.util.regex.Matcher; 11 | 12 | /** Redirect related functions in wiki and English Wiktionary. 13 | * 14 | * @see http://en.wiktionary.org/wiki/Wiktionary:Redirections 15 | */ 16 | public class WRedirectEn { 17 | 18 | /** Gets target page of the redirect, extracts [[pagename]] from double brackets. */ 19 | private final static Pattern ptrn_redirect = Pattern.compile( 20 | "#REDIRECT \\[\\[(.+?)\\]\\]", 21 | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); 22 | 23 | /** Checks whether this is a redirect page. If this is true then 24 | * the title of the target (redirected) page will be returned. 25 | * 26 | * @param wikt_lang language of Wiktionary 27 | * @param page_title word which are described in this article 28 | * @param text defines source wiki text 29 | * @return if this is not a redirect then return null 30 | */ 31 | public static String getRedirect(String page_title, 32 | StringBuffer text) { 33 | 34 | // #REDIRECT [[pagename]] (or #redirect [[pagename]] 35 | 36 | //int len = "#REDIRECT [[".length(); // == 12 37 | if(text.length() < 12 || text.charAt(0) != '#') 38 | return null; 39 | 40 | Matcher m = ptrn_redirect.matcher(text); 41 | if (m.find()){ 42 | return m.group(2); 43 | } 44 | 45 | return null; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/multi/ru/WRedirectRu.java: -------------------------------------------------------------------------------- 1 | /* WRedirectRu.java - functions related to redirects in wiki and Russian Wiktionary. 2 | * 3 | * Copyright (c) 2009 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.multi.ru; 8 | 9 | import java.util.regex.Pattern; 10 | import java.util.regex.Matcher; 11 | 12 | /** Redirect related functions in wiki and Russian Wiktionary. 13 | * 14 | * @see http://ru.wiktionary.org/wiki/Викисловарь:Перенаправления 15 | */ 16 | public class WRedirectRu { 17 | 18 | /** Gets target page of the redirect, extracts [[pagename]] from double brackets. */ 19 | private final static Pattern ptrn_redirect = Pattern.compile( 20 | "#(REDIRECT|ПЕРЕНАПРАВЛЕНИЕ) \\[\\[(.+?)\\]\\]", 21 | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); 22 | 23 | /** Checks whether this is a redirect page. If this is true then 24 | * the title of the target (redirected) page will be returned. 25 | * 26 | * @param wikt_lang language of Wiktionary 27 | * @param page_title word which are described in this article 28 | * @param text defines source wiki text 29 | * @return if this is not a redirect then return null 30 | */ 31 | public static String getRedirect(String page_title, 32 | StringBuffer text) { 33 | 34 | // #REDIRECT [[pagename]] (or #redirect [[pagename]] 35 | // or #ПЕРЕНАПРАВЛЕНИЕ [[pagename]] 36 | 37 | //int len = "#REDIRECT [[".length(); // == 12 38 | if(text.length() < 12 || text.charAt(0) != '#') 39 | return null; 40 | 41 | Matcher m = ptrn_redirect.matcher(text); 42 | if (m.find()){ 43 | return m.group(2); 44 | } 45 | 46 | return null; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/multi/ru/quote/TitleAndWikilink.java: -------------------------------------------------------------------------------- 1 | /* TitleAndWikilink.java - corresponds to the (wikified) title 2 | * of quote phrase/sentence that illustrates a meaning of a word in Russian Wiktionary. 3 | * 4 | * Copyright (c) 2012 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | package wikokit.base.wikt.multi.ru.quote; 8 | 9 | /** (Wikified) title of quote phrase / sentence. 10 | */ 11 | public class TitleAndWikilink { 12 | public TitleAndWikilink() { 13 | title = ""; 14 | title_wikilink = ""; 15 | } 16 | 17 | /** Title of the work. */ 18 | public String title; 19 | 20 | /** Link to a book in Wikipedia (format: [[s:title|]] or [[:s:title|]]). */ 21 | public String title_wikilink; 22 | 23 | 24 | /** Parses text (e.g. "[[:s:У окна (Андреев)|У окна]]") into 25 | * title_wikilink "У окна (Андреев)" and title "У окна". 26 | */ 27 | public void parseTitle(String text) { 28 | 29 | // replace " " by " " 30 | if(text.contains(" ")) 31 | text = text.replace(" ", " "); 32 | 33 | title = text; // first version 34 | if(!(text.startsWith("[[:s:") || 35 | text.startsWith("[[s:")) || 36 | !text.endsWith("]]") || 37 | !text.contains("|")) 38 | return; 39 | 40 | if(text.startsWith("[[:s:")) 41 | text = text.substring(5, text.length() - 2); // "[[:s:" . text . "]]" 42 | else 43 | text = text.substring(4, text.length() - 2); // "[[s:" . text . "]]" 44 | 45 | // split by | 46 | // [[:s:The title|The title]] 47 | int pos = text.indexOf("|"); 48 | if(-1 == pos) 49 | return; 50 | 51 | title_wikilink = text.substring(0, pos); 52 | title = text.substring(pos + 1); 53 | } 54 | } -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/util/LangText.java: -------------------------------------------------------------------------------- 1 | /* LangText.java - data structure consists of a language code and the corresponding text. 2 | * 3 | * Copyright (c) 2008 Andrew Krizhanovsky 4 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 5 | */ 6 | 7 | package wikokit.base.wikt.util; 8 | 9 | import wikokit.base.wikipedia.language.LanguageType; 10 | 11 | /** Data structure consists of a language code and the corresponding text. 12 | */ 13 | public class LangText { 14 | 15 | /** Language of the text, e.g. the article about one word can contain "en" block for English word, "de", "fr", etc. */ 16 | private LanguageType lang; 17 | 18 | /** Text */ 19 | public StringBuffer text; 20 | 21 | public LangText() {} 22 | 23 | public LangText(LanguageType _lang) { //, StringBuffer _text) { 24 | lang = _lang; 25 | text = new StringBuffer(); 26 | //text = _text; 27 | } 28 | 29 | /** Gets language of the text, e.g. "en" for English word, "de", "fr", etc. */ 30 | public LanguageType getLanguage() { 31 | return lang; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/util/POSText.java: -------------------------------------------------------------------------------- 1 | /* POSText - data structure consists of a POS code and the corresponding text. 2 | * 3 | * Copyright (c) 2008 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.util; 8 | 9 | //import wikt.constant.POSType; 10 | import wikokit.base.wikt.constant.POS; 11 | 12 | /** Data structure consists of a POS code and the corresponding text. */ 13 | public class POSText { 14 | 15 | /** Part of speech code of the text. */ 16 | private POS pos; 17 | 18 | /** POS name found in text, e.g. explicitly: "Verb", or implicitly "stitch I". */ 19 | //private String pos_name; 20 | 21 | /** Text */ 22 | private StringBuffer text; 23 | 24 | public POSText() {} 25 | 26 | /*public POSText(POSType _pos) { //, StringBuffer _text) { 27 | pos = _pos; 28 | text = new StringBuffer(); 29 | //text = _text; 30 | }*/ 31 | 32 | //public POSText(POSType _pos, StringBuffer _text) { 33 | public POSText(POS _pos, String _text) { 34 | pos = _pos; 35 | text = new StringBuffer(_text); 36 | } 37 | 38 | public POSText(POS _pos, StringBuffer _text) { 39 | pos = _pos; 40 | text = _text; 41 | } 42 | 43 | public POS getPOSType() { 44 | return pos; 45 | } 46 | 47 | public StringBuffer getText() { 48 | return text; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/word/WRedirect.java: -------------------------------------------------------------------------------- 1 | /* WRedirect.java - functions related to redirects in wiki and Wiktionary. 2 | * 3 | * Copyright (c) 2009 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.word; 8 | 9 | import wikokit.base.wikipedia.language.LanguageType; 10 | 11 | import wikokit.base.wikt.multi.ru.WRedirectRu; 12 | import wikokit.base.wikt.multi.en.WRedirectEn; 13 | 14 | /** Redirect related functions in wiki and Wiktionary. 15 | */ 16 | public class WRedirect { 17 | 18 | /** Checks whether this is a redirect page. If this is true then 19 | * the title of the target (redirected) page will be returned. 20 | * 21 | * @param wikt_lang language of Wiktionary 22 | * @param page_title word which are described in this article 23 | * @param text defines source wiki text 24 | * @return if this is not a redirect then return null 25 | */ 26 | public static String getRedirect(LanguageType wikt_lang, 27 | String page_title, 28 | StringBuffer text) { 29 | 30 | // #ПЕРЕНАПРАВЛЕНИЕ [[нелётный]] 31 | // #REDIRECT [[burn one's fingers]] 32 | 33 | LanguageType l = wikt_lang; 34 | String redirect_dest = null; 35 | 36 | if(l == LanguageType.ru) { 37 | redirect_dest = WRedirectRu.getRedirect(page_title, text); 38 | } else if(l == LanguageType.en) { 39 | redirect_dest = WRedirectEn.getRedirect(page_title, text); 40 | //} else if(code.equalsIgnoreCase( "simple" )) { 41 | // return WordSimple; 42 | 43 | // todo 44 | // ... 45 | 46 | } else { 47 | throw new NullPointerException("Null LanguageType"); 48 | } 49 | 50 | 51 | return redirect_dest; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /common_wiki/src/wikokit/base/wikt/word/WSynonyms.java: -------------------------------------------------------------------------------- 1 | /* WSynonyms.java - corresponds to a Synonym level of Wiktionary word. 2 | * 3 | * Copyright (c) 2008 Andrew Krizhanovsky 4 | * Distributed under GNU General Public License. 5 | */ 6 | 7 | package wikokit.base.wikt.word; 8 | 9 | import wikokit.base.wikt.util.WikiWord; 10 | 11 | /** Synonyms of Wiktionary word. 12 | */ 13 | public class WSynonyms { 14 | 15 | /** Comment for the set of synonyms, e.g. synonyms for "entry": 16 | * * (''act of entering''): [[access]], [[enter]]ing, [[entrance]], 17 | * * (''doorway that provides a means of entering a building''): [[entrance]], [[way in]] {{UK}} 18 | * .comment=act of entering 19 | * .comment=doorway... 20 | * .words[1].tag=UK 21 | */ 22 | private String[] comment; 23 | 24 | /** Synonyms list with tags */ 25 | private WikiWord[] words; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /common_wiki/test/wikokit/base/wikipedia/text/TableParserTest.java: -------------------------------------------------------------------------------- 1 | package wikokit.base.wikipedia.text; 2 | 3 | import wikokit.base.wikipedia.text.TableParser; 4 | import junit.framework.TestCase; 5 | 6 | public class TableParserTest extends TestCase { 7 | 8 | public TableParserTest(String testName) { 9 | super(testName); 10 | } 11 | 12 | @Override 13 | protected void setUp() throws Exception { 14 | super.setUp(); 15 | } 16 | 17 | @Override 18 | protected void tearDown() throws Exception { 19 | super.tearDown(); 20 | } 21 | 22 | /** 23 | * Test of removeWikiTables method, of class TableParser. 24 | */ 25 | public void testRemoveWikiTables() { 26 | System.out.println("removeWikiTables"); 27 | StringBuffer text, expResult, result; 28 | 29 | // simple 30 | text = new StringBuffer("a {| text1 \n text2 |} b"); 31 | expResult = new StringBuffer("a b"); 32 | result = TableParser.removeWikiTables(text); 33 | assertTrue(expResult.toString().equalsIgnoreCase( result.toString() ) ); 34 | 35 | // nested tables {| {| |} |} 36 | text = new StringBuffer("c {| text1 \n {| table2 \n|}|} d"); 37 | expResult = new StringBuffer("c d"); 38 | result = TableParser.removeWikiTables(text); 39 | assertTrue(expResult.toString().equalsIgnoreCase( result.toString() ) ); 40 | 41 | // nested tables and sequence of tables 42 | text = new StringBuffer("c {| text1 \n {| table2 \n|}|} d {| text3 |} e"); 43 | expResult = new StringBuffer("c d e"); 44 | result = TableParser.removeWikiTables(text); 45 | assertTrue(expResult.toString().equalsIgnoreCase( result.toString() ) ); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /common_wiki/test/wikokit/base/wikt/word/WLanguageTest.java: -------------------------------------------------------------------------------- 1 | 2 | package wikokit.base.wikt.word; 3 | 4 | import org.junit.After; 5 | import org.junit.AfterClass; 6 | import org.junit.Before; 7 | import org.junit.BeforeClass; 8 | import org.junit.Test; 9 | import static org.junit.Assert.*; 10 | import wikokit.base.wikipedia.language.LanguageType; 11 | 12 | public class WLanguageTest { 13 | 14 | public WLanguageTest() { 15 | } 16 | 17 | @BeforeClass 18 | public static void setUpClass() throws Exception { 19 | } 20 | 21 | @AfterClass 22 | public static void tearDownClass() throws Exception { 23 | } 24 | 25 | @Before 26 | public void setUp() { 27 | } 28 | 29 | @After 30 | public void tearDown() { 31 | } 32 | 33 | // @see WMeaningEnTest with section "Form of templates" 34 | 35 | @Test 36 | public void testParse_something() { 37 | System.out.println("todo or not todo"); 38 | } 39 | 40 | 41 | 42 | } -------------------------------------------------------------------------------- /common_wiki_jdbc/lib/sqlite-jdbc-3.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/common_wiki_jdbc/lib/sqlite-jdbc-3.7.2.jar -------------------------------------------------------------------------------- /common_wiki_jdbc/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=10174ac1 2 | build.xml.script.CRC32=53dda539 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=10174ac1 7 | nbproject/build-impl.xml.script.CRC32=b0e2cbeb 8 | nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 9 | -------------------------------------------------------------------------------- /common_wiki_jdbc/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | common_wiki_jdbc 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | common_wiki 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /common_wiki_jdbc/src/wikokit/base/wikipedia/sql/UtilSQL.java: -------------------------------------------------------------------------------- 1 | 2 | package wikokit.base.wikipedia.sql; 3 | 4 | import java.sql.*; 5 | 6 | /** Misc SQL routines. 7 | */ 8 | public class UtilSQL { 9 | 10 | /** Deletes all records from the table 'table_name', resets auto increment. 11 | * 12 | * DELETE FROM table_name; 13 | * ALTER TABLE table_name AUTO_INCREMENT = 1; 14 | */ 15 | public static void deleteAllRecordsResetAutoIncrement (Connect connect, String table_name) { 16 | 17 | Statement s = null; 18 | ResultSet rs= null; 19 | 20 | try { 21 | s = connect.conn.createStatement (); 22 | s.addBatch("DELETE FROM "+ table_name +";"); 23 | s.addBatch("ALTER TABLE "+ table_name +" AUTO_INCREMENT = 1;"); 24 | s.executeBatch(); 25 | 26 | } catch(SQLException ex) { 27 | System.out.println("SQLException (wikipedia.sql UtilSQL.java deleteAllRecordsResetAutoIncrement()):: table = "+ table_name +"; msg = " + ex.getMessage()); 28 | } finally { 29 | if (rs != null) { try { rs.close(); } catch (SQLException sqlEx) { } rs = null; } 30 | if (s != null) { try { s.close(); } catch (SQLException sqlEx) { } s = null; } 31 | } 32 | } 33 | 34 | 35 | public static void dropTable (Connect connect, String table_name) 36 | { 37 | if(null == connect) 38 | return; 39 | 40 | StringBuffer str_sql = new StringBuffer(); 41 | try { 42 | Statement s = connect.conn.createStatement (); 43 | try { 44 | str_sql.append("DROP TABLE IF EXISTS `"+ table_name + "`"); 45 | s.execute(str_sql.toString()); 46 | } finally { 47 | s.close(); 48 | } 49 | } catch(SQLException ex) { 50 | System.out.println("SQLException (MSRMeanSemrelXX.dropTable()): sql='" + str_sql + "' " + ex.getMessage()); 51 | } 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /common_wiki_jdbc/src/wikokit/base/wikt/sql/index/NativeRedLink.java: -------------------------------------------------------------------------------- 1 | /* NativeRedLink.java - SQL operations with the table 'native_red_link' 2 | * in Wiktionary parsed database. 3 | * 4 | * Copyright (c) 2009 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | 8 | package wikokit.base.wikt.sql.index; 9 | 10 | /** The table 'native_red_link' - list of red link words (without articles) 11 | * in native language, which were found in other WT articles in native language 12 | * (table in Wiktionary parsed database). 13 | */ 14 | public class NativeRedLink { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /common_wiki_jdbc/src/wikokit/base/wikt/sql/label/TLabelRelation.java: -------------------------------------------------------------------------------- 1 | /* TLabelRelation.java - SQL operations with the table 'label_relation' in Wiktionary 2 | * parsed database. 3 | * 4 | * Copyright (c) 2013 Andrew Krizhanovsky 5 | * Distributed under EPL/LGPL/GPL/AL/BSD multi-license. 6 | */ 7 | package wikokit.base.wikt.sql.label; 8 | 9 | import wikokit.base.wikt.sql.TRelation; 10 | 11 | /** An operations with the table 'label_relation' in MySQL Wiktionary_parsed database. 12 | * label_relation - binds together context labels and semantic relation number. 13 | */ 14 | public class TLabelRelation { 15 | 16 | /** Context label (label_id). */ 17 | private TLabel label; 18 | 19 | /** One semantic relation of a word (relation_id). */ 20 | private TRelation relation; 21 | 22 | } -------------------------------------------------------------------------------- /common_wiki_jdbc/test/wikokit/base/wikt/sql/quote/TQuotTranscriptionTest.java: -------------------------------------------------------------------------------- 1 | 2 | package wikokit.base.wikt.sql.quote; 3 | 4 | import wikokit.base.wikt.sql.quote.TQuotTranscription; 5 | import org.junit.After; 6 | import org.junit.AfterClass; 7 | import org.junit.Before; 8 | import org.junit.BeforeClass; 9 | import org.junit.Test; 10 | import static org.junit.Assert.*; 11 | import wikokit.base.wikipedia.language.LanguageType; 12 | import wikokit.base.wikipedia.sql.Connect; 13 | 14 | public class TQuotTranscriptionTest { 15 | 16 | public Connect ruwikt_parsed_conn; 17 | 18 | public TQuotTranscriptionTest() { 19 | } 20 | 21 | @BeforeClass 22 | public static void setUpClass() throws Exception { 23 | } 24 | 25 | @AfterClass 26 | public static void tearDownClass() throws Exception { 27 | } 28 | 29 | @Before 30 | public void setUp() { 31 | ruwikt_parsed_conn = new Connect(); 32 | ruwikt_parsed_conn.Open(Connect.RUWIKT_HOST,Connect.RUWIKT_PARSED_DB,Connect.RUWIKT_USER,Connect.RUWIKT_PASS,LanguageType.ru); 33 | } 34 | 35 | @After 36 | public void tearDown() { 37 | ruwikt_parsed_conn.Close(); 38 | } 39 | 40 | @Test 41 | public void testInsert() { 42 | System.out.println("insert_ru"); 43 | Connect connect = ruwikt_parsed_conn; 44 | 45 | int quote_id = 888888; 46 | String text = "test_test_test2"; 47 | 48 | TQuotTranscription result = TQuotTranscription.insert(connect, quote_id, text); 49 | assertNotNull(result); 50 | 51 | TQuotTranscription get = TQuotTranscription.getByID(connect, quote_id); 52 | assertNotNull( get ); 53 | assertEquals(0, result.getText().compareTo( get.getText() )); 54 | 55 | result.delete(connect); 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /common_wiki_jdbc/test/wikokit/base/wikt/sql/quote/TQuotTranslationTest.java: -------------------------------------------------------------------------------- 1 | 2 | package wikokit.base.wikt.sql.quote; 3 | 4 | import wikokit.base.wikt.sql.quote.TQuotTranslation; 5 | import org.junit.After; 6 | import org.junit.AfterClass; 7 | import org.junit.Before; 8 | import org.junit.BeforeClass; 9 | import org.junit.Test; 10 | import static org.junit.Assert.*; 11 | import wikokit.base.wikipedia.language.LanguageType; 12 | import wikokit.base.wikipedia.sql.Connect; 13 | 14 | public class TQuotTranslationTest { 15 | 16 | public Connect ruwikt_parsed_conn; 17 | 18 | public TQuotTranslationTest() { 19 | } 20 | 21 | @BeforeClass 22 | public static void setUpClass() throws Exception { 23 | } 24 | 25 | @AfterClass 26 | public static void tearDownClass() throws Exception { 27 | } 28 | 29 | @Before 30 | public void setUp() { 31 | ruwikt_parsed_conn = new Connect(); 32 | ruwikt_parsed_conn.Open(Connect.RUWIKT_HOST,Connect.RUWIKT_PARSED_DB,Connect.RUWIKT_USER,Connect.RUWIKT_PASS,LanguageType.ru); 33 | } 34 | 35 | @After 36 | public void tearDown() { 37 | ruwikt_parsed_conn.Close(); 38 | } 39 | 40 | @Test 41 | public void testInsert() { 42 | System.out.println("insert_ru"); 43 | Connect connect = ruwikt_parsed_conn; 44 | 45 | int quote_id = 777777; 46 | String text = "test_test_test"; 47 | 48 | TQuotTranslation result = TQuotTranslation.insert(connect, quote_id, text); 49 | assertNotNull(result); 50 | 51 | TQuotTranslation get = TQuotTranslation.getByID(connect, quote_id); 52 | assertNotNull( get ); 53 | assertEquals(0, result.getText().compareTo( get.getText() )); 54 | 55 | result.delete(connect); 56 | } 57 | 58 | 59 | 60 | } -------------------------------------------------------------------------------- /hits_wiki/docs/bugs.personal.txt: -------------------------------------------------------------------------------- 1 | 2 | Список категорий пустой, 3 | if(Log) 4 | total_steps_while_categories_removing:1093 5 | else 6 | total_steps_while_categories_removing:0 7 | 8 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/add_javawiki_to_mysql.sgm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | Add the user (e.g. 'javawiki') to MySQL database. Grant 5 | privileges at database levels (e.g. 'ruwiki' database). 6 | Open MySQL command-line and run commands: 7 | mysql>CREATE USER javawiki; 8 | mysql>GRANT SELECT ON ruwiki.* TO javawiki@'localhost'; 9 | (with password; from any computer>GRANT SELECT PRIVILEGES ON ruwiki.* TO javawiki identified by '12345') 10 | mysql>FLUSH PRIVILEGES; 11 |
12 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/download_wp_dumps_four_tables.sgm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | Download Wikipedia dumps from Wikimedia Foundation project: (select "Database backup dumps"). See more about Data_dumps. Synarcher works with four MySQL tables: page, pagelinks, categorylinks, and interwiki. In order to run Synarcher it is enough to download four files, e.g. ruwiki-20070304-pages-articles.xml.bz2, ruwiki-20070304-pagelinks.sql.gz, ruwiki-20070304-categorylinks.sql.gz, and ruwiki-20070304-interwiki.sql.gz (Russian Wikipedia). 5 | 6 |
7 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/03a_crop_search_parameters_robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/03a_crop_search_parameters_robot.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/04_results_table_and_graph_robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/04_results_table_and_graph_robot.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/chechnya_iwiki_eo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/chechnya_iwiki_eo.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/db_eo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/db_eo.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/enc_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/enc_tab.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/orbita.ru.rate_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/orbita.ru.rate_circle.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/html/figures/quantity_en_categories_region.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/html/figures/quantity_en_categories_region.png -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/index.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/index.xml -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/index.xml.new: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/index.xml.new -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/index_ru.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/index_ru.xml -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/project_synarcher_ru.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/docbook/project_synarcher_ru.xml -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/sh.index.xsltproc.sh: -------------------------------------------------------------------------------- 1 | # mandriva 2 | # xsltproc -o ./html/index.html /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl index.xml 3 | # 4 | # debian 5 | xsltproc -o ./html/index.html /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/docbook.xsl index.xml 6 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/sh.project_synarcher.sh: -------------------------------------------------------------------------------- 1 | xsltproc -o ./html/project_synarcher.html /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl project_synarcher.xml 2 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/sh.project_synarcher_ru.sh: -------------------------------------------------------------------------------- 1 | xsltproc -o ./html/project_synarcher_ru.html /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl project_synarcher_ru.xml 2 | -------------------------------------------------------------------------------- /hits_wiki/docs/docbook/sh_ru_index.xsltproc.sh: -------------------------------------------------------------------------------- 1 | xsltproc -o ./html/index_ru.html /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl index_ru.xml 2 | -------------------------------------------------------------------------------- /hits_wiki/docs/experiments.personal.txt: -------------------------------------------------------------------------------- 1 | 2 | 1) Esperanto ========== 3 | Слова для поиска: 4 | Misc: C^eC^enio Tiberiado 5 | Science: Patologio Logaritmo Spino Hidrau^liko Simetrio Sudoko 6 | Disaster: Klimato Ekologio Arbaro (лес) Ponto Gihado Milito Terorismo Agfilmo (боевик) Rifug^into (беженцы) 7 | Katastrofo_(akcidento) 8 | -------------------------------------------------------------------------------- /hits_wiki/docs/ideas.kleinberg.personal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/ideas.kleinberg.personal.txt -------------------------------------------------------------------------------- /hits_wiki/docs/settings.personal.txt: -------------------------------------------------------------------------------- 1 | 2 | Q: Error: java.lang.OutOfMemoryError: Java heap space 3 | A: Solution for Netbeans Java IDE. 4 | 5 | Values are specified in the project. If I right-click the project and 6 | then choose Properties the properties dialog appears. On the left-hand side I 7 | choose Run and that causes the right-hand side to display runtime properties. 8 | The values for Xmx, etc. are specified in the VM Options entry. 9 | 10 | XX:+AgressiveHeap 11 | default: 12 | -J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-Xverify:none 13 | test: 14 | -Xms512m -Xmx512m -Xmn16m -XX:PermSize=4m -XX:MaxPermSize=4m -XX:+DisableExplicitGC -verbose:gc 15 | 16 | my: 17 | java.lang.OutOfMemoryError: PermGen space 18 | -Xms256m -Xmx256m -Xmn16m -XX:PermSize=4m -XX:MaxPermSize=4m -XX:+DisableExplicitGC -verbose:gc 19 | 20 | -Xms256m -Xmx256m -Xmn16m -XX:+DisableExplicitGC -verbose:gc 21 | -Xms320m -Xmx320m -Xmn16m -XX:+DisableExplicitGC -verbose:gc 22 | -Xms400m -Xmx400m -Xmn16m -XX:+DisableExplicitGC -verbose:gc 23 | -------------------------------------------------------------------------------- /hits_wiki/docs/sourceforge.personal/abstract.txt: -------------------------------------------------------------------------------- 1 | UNIX Name:synarcher 2 | Descriptive Name:Synarcher 3 | easyjapan@mail.ru 4 | GPL 5 | 6 | abstract: 7 | The system searches synonyms (and related words) in Wikipedia. Results of search are presented in the form of graph. Nodes are the names of articles, links show the relations between words (hyperlinks between articles). 8 | 9 | temp abstract: 10 | The system searches synonyms (and related words) in Wikipedia. (Current work plan: The format of Wikipedia database was changed. It is need to rewrite the low-level of Synarcher in order to access the new version of Wikipedia.) 11 | -------------------------------------------------------------------------------- /hits_wiki/docs/sql.personal/sql_batch.bat: -------------------------------------------------------------------------------- 1 | :: work 2 | "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysql" -u root -pmysql9740 -e "source E:\all\projects\JAVA\synonyms\kleinberg\src\sql_batch.sql" > sql_batch.out 3 | :: 4 | :: home 5 | :: mysql -u root -p1234 -e "source E:\projects\java\synonyms\kleinberg\sql_batch.sql" > sql_batch.out 6 | ::mysql -e "source E:\projects\java\synonyms\kleinberg\sql_batch.sql" > sql_batch.out -------------------------------------------------------------------------------- /hits_wiki/docs/sql.personal/sql_batch.out: -------------------------------------------------------------------------------- 1 | cur_id cur_title 2 | 18991 Трансформеры 3 | 22233 Робот_(значения) 4 | -------------------------------------------------------------------------------- /hits_wiki/docs/sql.personal/sql_batch.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/sql.personal/sql_batch.sql -------------------------------------------------------------------------------- /hits_wiki/docs/sql.personal/sql_wikipedia.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/sql.personal/sql_wikipedia.txt -------------------------------------------------------------------------------- /hits_wiki/docs/sql.personal/wikipedia_article_example.txt: -------------------------------------------------------------------------------- 1 | '''Consciousness''' is a quality of the [[mind]] generally regarded to comprise qualities such as [[subjectivity]], [[self-awareness]], [[sentience]], [[sapience]], and the ability to [[perception|perceive]] the relationship between [[personal identity|oneself]] and one's [[environment]]. In common parlance, ''consciousness'' denotes being [[awake]] and responsive to one's environment; this contrasts with being [[sleep|asleep]] or being in a [[coma]]. 2 | 3 | Consciousness is notoriously difficult to define or locate. Many cultures and religious traditions place the seat of consciousness in a [[soul]] separate from the body. Conversely, many scientists and philosophers consider consciousness to be intimately linked to the neural functioning of the [[brain]]. 4 | 5 | An understanding of necessary preconditions for consciousness in the human brain may allow us to address important ethical questions. For instance, to what extent are non-human animals conscious? At what point in fetal development does consciousness begin? Can machines ever achieve conscious states? These issues are of great interest to those concerned with the ethical treatment of other beings, be they [[animal rights|animals]], [[abortion|fetuses]], or in the future, [[artificial consciousness|machines]]. -------------------------------------------------------------------------------- /hits_wiki/docs/src.Links.getAllLinks.personal/getAllLinks.txt: -------------------------------------------------------------------------------- 1 | --- 2 | //Links.getAllLinksFromNodes(session, map_title_article, base_nodes1); 3 | Links.getAllLinks(session, map_title_article); 4 | --- 5 | Random:disable 6 | Страны|Века|Календарь|География_России|Люди 7 | 8 | Links.getAllLinks 9 | 10 | Россия 10 10 11 | time sec:51.765 iter:4 vertices:518 edges:61589 12 | root_set_size:10 increment:10 13 | n_synonyms:100 14 | categories:854 total_steps_while_categories_removing:6606 15 | 16 | Россия 100 17 17 | time sec:29.005 iter:11 vertices:1972 edges:85132 18 | root_set_size:100 increment:17 19 | n_synonyms:100 20 | categories:2065 total_steps_while_categories_removing:22201 21 | 22 | Пыльник 23 | time sec:1.126 iter:13 vertices:69 edges:213 24 | root_set_size:100 increment:17 25 | n_synonyms:100 26 | categories:220 total_steps_while_categories_removing:1110 27 | 28 | Сленг 29 | time sec:3.741 iter:31 vertices:123 edges:280 30 | root_set_size:100 increment:17 31 | n_synonyms:100 32 | categories:447 total_steps_while_categories_removing:1951 33 | 34 | Робот 35 | time sec:6.622 iter:36 vertices:580 edges:3760 36 | root_set_size:100 increment:17 37 | n_synonyms:100 38 | categories:1041 total_steps_while_categories_removing:8264 39 | 40 | Интернационализация 41 | time sec:3.547 iter:20 vertices:201 edges:844 42 | root_set_size:100 increment:17 43 | n_synonyms:100 44 | categories:489 total_steps_while_categories_removing:5102 45 | 46 | Джемини 1 1 47 | time sec:0.496 iter:14 vertices:9 edges:10 48 | root_set_size:1 increment:1 49 | n_synonyms:100 50 | categories:65 total_steps_while_categories_removing:205 51 | 52 | 53 | -------------------------------------------------------------------------------- /hits_wiki/docs/todo.kleinberg.personal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/docs/todo.kleinberg.personal.txt -------------------------------------------------------------------------------- /hits_wiki/lib/commons-collections-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/commons-collections-3.1.jar -------------------------------------------------------------------------------- /hits_wiki/lib/commons-collections-testframework-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/commons-collections-testframework-3.1.jar -------------------------------------------------------------------------------- /hits_wiki/lib/commons-lang-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/commons-lang-2.1.jar -------------------------------------------------------------------------------- /hits_wiki/lib/commons-logging-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/commons-logging-api.jar -------------------------------------------------------------------------------- /hits_wiki/lib/commons-logging.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/commons-logging.jar -------------------------------------------------------------------------------- /hits_wiki/lib/jakarta-oro-2.0.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/componavt/wikokit/0db2310283d792abbaa57746fe9fe475fe9e6ab8/hits_wiki/lib/jakarta-oro-2.0.8.jar -------------------------------------------------------------------------------- /hits_wiki/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=4e456aed 2 | build.xml.script.CRC32=d7ddf66f 3 | build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45 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=4e456aed 7 | nbproject/build-impl.xml.jax-ws.CRC32=749ccaa7 8 | nbproject/build-impl.xml.script.CRC32=b0a1b5fe 9 | nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 10 | nbproject/profiler-build-impl.xml.data.CRC32=e46e27d4 11 | nbproject/profiler-build-impl.xml.script.CRC32=abda56ed 12 | nbproject/profiler-build-impl.xml.stylesheet.CRC32=a5b6598e 13 | -------------------------------------------------------------------------------- /hits_wiki/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | hits_wiki 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 | jcfd 26 | jar 27 | 28 | jar 29 | clean 30 | jar 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /hits_wiki/src/rfc2229/WordNetParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WordNetParser.java 3 | * 4 | * Copyright (c) 2005 Andrew Krizhanovsky /aka at mail.iias.spb.su/ 5 | * Distributed under GNU Public License. 6 | */ 7 | 8 | package rfc2229; 9 | 10 | import java.util.List; 11 | import java.util.ArrayList; 12 | 13 | import java.util.regex.Pattern; 14 | import java.util.regex.Matcher; 15 | 16 | import wikipedia.util.StringUtil; 17 | import wikipedia.util.StringUtilRegular; 18 | 19 | 20 | /** Parses text of Wordnet's articles */ 21 | public class WordNetParser { 22 | 23 | public WordNetParser() { 24 | } 25 | 26 | /** Searches in the text something like "[syn: {sugar}, {one more sugar\r\n}]", and 27 | * extracts as list "sugar", "one more sugar" if the sought type is "syn". 28 | * 29 | * @params link_type There are the following types: syn, ant, also. 30 | */ 31 | public static List getLinks(String link_type, String text) { 32 | String str_pattern = "\\[" + link_type + "\\:\\s([^\\]]+)\\]"; 33 | 34 | List result = new ArrayList(); 35 | Pattern p = Pattern.compile(str_pattern); 36 | Matcher m = p.matcher(text); 37 | 38 | while (m.find()){ 39 | String[] words = StringUtil.split(", ", m.group(1)); 40 | 41 | StringUtilRegular.stripNonWordLetters(words); 42 | for(String w: words) { 43 | if(!result.contains(w)) { 44 | result.add(w); 45 | } 46 | } 47 | } 48 | return result; 49 | } 50 | 51 | public static List getSynonyms(String text) { 52 | return StringUtil.addOR( 53 | getLinks("syn", text), 54 | getLinks("also", text) ); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /hits_wiki/src/wikipedia/clustering/HolderCluster.java: -------------------------------------------------------------------------------- 1 | /* 2 | * HolderCluster.java - Store main data: vertices, edges, clusters 3 | * @author Andrew Krizhanovsky /mail: aka at mail.iias.spb.su/ 4 | * Created on 21 June 2005 5 | * 6 | */ 7 | 8 | package wikipedia.clustering; 9 | 10 | import wikipedia.kleinberg.*; 11 | //import wikipedia.util.*; 12 | import java.util.*; 13 | 14 | /** 15 | * Class Description 16 | * 17 | */ 18 | public class HolderCluster { 19 | 20 | public DumpToGraphViz dump; 21 | ArrayList clusters; 22 | HashMap categories; /** */ 23 | HashMap edges; 24 | 25 | /** Creates a new instance of HolderCluster */ 26 | public HolderCluster() { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /hits_wiki/src/wikipedia/experiment/WordSim.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WordSim.java - words similarity data object. calculator. 3 | * 4 | * Copyright (c) 2005-2007 Andrew Krizhanovsky /aka at mail.iias.spb.su/ 5 | * Distributed under GNU Public License. 6 | */ 7 | 8 | package wikipedia.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 | } -------------------------------------------------------------------------------- /hits_wiki/src/wikipedia/kleinberg/DCEL.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DCEL.java Dcel (Doubly Connected Edge List). Operations with HashMap 3 | * 4 | * Copyright (c) 2005 Andrew Krizhanovsky /aka at mail.iias.spb.su/ 5 | * Distributed under GNU Public License. 6 | */ 7 | 8 | package wikipedia.kleinberg; 9 | 10 | import wikipedia.util.*; 11 | import java.util.*; 12 | 13 | public class DCEL { 14 | 15 | public DCEL() { 16 | } 17 | 18 | //hm.values().size(); - number of vertices 19 | 20 | /** 21 | * Count half number of all arcs in the structure 22 | */ 23 | public static int CountLinksIn(Map hm) { 24 | 25 | Iterator it = hm.values().iterator(); 26 | Integer counter; 27 | 28 | counter = 0; 29 | while (it.hasNext()) { 30 | 31 | /*T a = it.next(); 32 | if (!(a instanceof Node)) 33 | return 0; 34 | */ 35 | Node node = (Node)it.next(); 36 | if(null != node.links_in) // count only links_in (i.e. skip links_out) 37 | counter += node.links_in.length; // because every link has the begin in the structure 38 | } 39 | return counter; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /hits_wiki/src/wikipedia/sql/maintenance/RefreshLinks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * RefreshLinks.java - Refreshes the table pagelinks using [[links]] within 3 | * articles text (ideas from mediawiki/maintenance/refreshLinks.php). 4 | * 5 | * Copyright (c) 2005, 2006 Andrew Krizhanovsky /aka at mail.iias.spb.su/ 6 | * Distributed under GNU Public License. 7 | */ 8 | 9 | package wikipedia.sql.maintenance; 10 | 11 | public class RefreshLinks { 12 | 13 | public RefreshLinks() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /hits_wiki/test/wikipedia/data/RemovedArticlesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * RemovedArticlesTest.java 3 | * JUnit based test 4 | */ 5 | 6 | package wikipedia.data; 7 | 8 | import junit.framework.*; 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | 13 | public class RemovedArticlesTest extends TestCase { 14 | 15 | RemovedArticles removed_articles = new RemovedArticles(); 16 | 17 | public RemovedArticlesTest(String testName) { 18 | super(testName); 19 | } 20 | 21 | protected void setUp() throws Exception { 22 | } 23 | 24 | protected void tearDown() throws Exception { 25 | } 26 | 27 | /** 28 | * Test of addTitle method, of class wikipedia.data.RemovedArticles. 29 | */ 30 | public void testAddTitle() { 31 | System.out.println("addTitle"); 32 | 33 | String s1 = "string1"; 34 | String s2 = "string2"; 35 | 36 | removed_articles.addTitle(s1); 37 | removed_articles.addTitle(s2); 38 | removed_articles.addTitle(s2); 39 | 40 | assertEquals(2, removed_articles.sizeTitle()); 41 | } 42 | 43 | /** 44 | * Test of addId method, of class wikipedia.data.RemovedArticles. 45 | */ 46 | public void testAddId() { 47 | System.out.println("addId"); 48 | 49 | assertEquals(0, removed_articles.sizeId()); 50 | removed_articles.addId(11); 51 | removed_articles.addId(12); 52 | removed_articles.addId(12); 53 | assertEquals(2, removed_articles.sizeId()); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /hits_wiki/test/wikipedia/kleinberg/DCELTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DCELTest.java 3 | * JUnit based test 4 | * @author Andrew Krizhanovsky /mail: aka at mail.iias.spb.su/ 2005 LGPL 5 | */ 6 | 7 | package wikipedia.kleinberg; 8 | 9 | import wikipedia.sql.*; 10 | import wikipedia.util.*; 11 | import junit.framework.*; 12 | import java.sql.*; 13 | import java.util.*; 14 | 15 | 16 | public class DCELTest extends TestCase { 17 | 18 | public DCELTest(String testName) { 19 | super(testName); 20 | } 21 | 22 | protected void setUp() throws java.lang.Exception { 23 | } 24 | 25 | protected void tearDown() throws java.lang.Exception { 26 | /*connect.Close(); 27 | connect_ru.Close();*/ 28 | } 29 | 30 | public static junit.framework.Test suite() { 31 | junit.framework.TestSuite suite = new junit.framework.TestSuite(DCELTest.class); 32 | 33 | return suite; 34 | } 35 | 36 | /** 37 | * Test of CountArcAndVertices method, of class wikipedia.DCEL. 38 | */ 39 | public void testCountArcs() { 40 | 41 | Article[] source_nodes = new Article[2]; 42 | source_nodes[0] = new Article(); 43 | source_nodes[1] = new Article(); 44 | 45 | source_nodes[0].links_in = new int[7]; 46 | source_nodes[1].links_in = new int[5]; 47 | 48 | HashMap hash_node = new HashMap(); 49 | hash_node.put(0, source_nodes[0]); 50 | hash_node.put(1, source_nodes[1]); 51 | 52 | int i = DCEL.CountLinksIn(hash_node); 53 | assertEquals(i, 12); 54 | } 55 | 56 | 57 | 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /hits_wiki/test/wikipedia/kleinberg/SessionHolderTest.java: -------------------------------------------------------------------------------- 1 | package wikipedia.kleinberg; 2 | 3 | import junit.framework.*; 4 | import wikipedia.sql.*; 5 | import wikipedia.util.*; 6 | import java.util.*; 7 | 8 | public class SessionHolderTest extends TestCase { 9 | 10 | public SessionHolderTest(String testName) { 11 | super(testName); 12 | } 13 | 14 | protected void setUp() throws Exception { 15 | } 16 | 17 | protected void tearDown() throws Exception { 18 | } 19 | 20 | public static Test suite() { 21 | TestSuite suite = new TestSuite(SessionHolderTest.class); 22 | 23 | return suite; 24 | } 25 | 26 | public void testSkipTitle() { 27 | System.out.println("skipTitle"); 28 | 29 | String str = "Words_with_spaces"; 30 | SessionHolder sh = new SessionHolder(); 31 | assertEquals(true, sh.skipTitle(str)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hits_wiki/test/wikipedia/sql_idf/PageTest.java: -------------------------------------------------------------------------------- 1 | 2 | package wikipedia.sql_idf; 3 | 4 | import wikipedia.sql.Connect; 5 | 6 | import java.sql.Connection; 7 | import java.util.*; 8 | import junit.framework.TestCase; 9 | 10 | public class PageTest extends TestCase { 11 | 12 | public Connect idfruwiki_conn; 13 | public Connect idfsimplewiki_conn; 14 | 15 | public List tp_list1, tp_list2; 16 | Term t1, t2; 17 | String lemma1, lemma2; 18 | 19 | public PageTest(String testName) { 20 | super(testName); 21 | } 22 | 23 | @Override 24 | protected void setUp() throws Exception { 25 | super.setUp(); 26 | 27 | idfruwiki_conn = new Connect(); 28 | idfruwiki_conn.Open(Connect.IDF_RU_HOST, Connect.IDF_RU_DB, Connect.IDF_RU_USER, Connect.IDF_RU_PASS); 29 | 30 | idfsimplewiki_conn = new Connect(); 31 | idfsimplewiki_conn.Open(Connect.IDF_SIMPLE_HOST, Connect.IDF_SIMPLE_DB, Connect.IDF_SIMPLE_USER, Connect.IDF_SIMPLE_PASS); 32 | 33 | java.sql.Connection conn = idfsimplewiki_conn.conn; 34 | lemma1 = "GREEN"; 35 | lemma2 = "TEA"; 36 | t1 = Term.get(conn, lemma1); 37 | t2 = Term.get(conn, lemma2); 38 | tp_list1 = TermPage.getPagesByTermID(conn, t1); 39 | tp_list2 = TermPage.getPagesByTermID(conn, t2); 40 | } 41 | 42 | @Override 43 | protected void tearDown() throws Exception { 44 | super.tearDown(); 45 | } 46 | 47 | /** 48 | * Test of fillPages method, of class Page. 49 | */ 50 | public void testFillPages_simple() { 51 | System.out.println("fillPages_simple"); 52 | java.sql.Connection conn = idfsimplewiki_conn.conn; 53 | 54 | Page.fillPages(conn, tp_list1); 55 | Page.fillPages(conn, tp_list2); 56 | 57 | List 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 |

piwidict - PHP framework to work with Wiktionary parsed database

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 | --------------------------------------------------------------------------------