This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Lila Prototype 0.2 - johnmiedema.com</title> | |
</head> | |
<body> | |
<?php | |
//References | |
//https://gist.github.com/chasewoodford/51e185ed1d49862bf988 | |
//https://developers.google.com/chart/interactive/docs/gallery/linechart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
-------------------------------------------------------------------------- | |
EVERNOTE RANDOM | |
Use with IFTTT.com to get a daily random evernote note sent to your email | |
When link is opened, view it in your Evernote app | |
Edit a note daily to keep up on them all | |
-------------------------------------------------------------------------- | |
Requirements: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Extract SolrQuery response data | |
//johnmiedema.com | |
package demoCrawlIndexQuery; | |
import org.apache.solr.client.solrj.SolrQuery; | |
import org.apache.solr.client.solrj.SolrServer; | |
import org.apache.solr.client.solrj.SolrServerException; | |
import org.apache.solr.client.solrj.impl.HttpSolrServer; | |
import org.apache.solr.client.solrj.response.QueryResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Test a custom OpenNLP model for NER of book titles | |
//See https://gist.github.com/johnmiedema/4020deea875ce306971e | |
package demoModelTrainer; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import opennlp.tools.namefind.NameFinderME; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create an OpenNLP model for Named Entity Recognition of Book Titles | |
//See tester at https://gist.github.com/johnmiedema/7e7330e1b9263267bdfc | |
package demoModelTrainer; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.util.Collections; | |
import opennlp.tools.namefind.NameFinderME; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demoNameFind; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import opennlp.tools.namefind.NameFinderME; | |
import opennlp.tools.namefind.TokenNameFinderModel; | |
import opennlp.tools.tokenize.Tokenizer; | |
import opennlp.tools.tokenize.TokenizerME; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demoParseNounPhrases; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.HashSet; | |
import java.util.Set; | |
import opennlp.tools.cmdline.parser.ParserTool; | |
import opennlp.tools.parser.Parse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Use Apache Tika and Solr to crawl, index and search documents | |
//John Miedema http://johnmiedema.com | |
//----------------------------------------------------------- | |
//referenced libraries: | |
//Apache Tika 1.5 | |
//Apache Solr 4.7.2 | |
//Apache HttpClient 4.3.3 reqd to connect to Solr server | |
//Noggit json parser reqd for Solr commands | |
//----------------------------------------------------------- | |
//after Solr is downloaded, start it using the following commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Use Apache Tika to extract metadata and convert different content types into plain text | |
//'Whatson' blog series at johnmiedema.com | |
//http://johnmiedema.com/?tag=whatson | |
//source documents include different content types | |
processDocument("resources/mobydick.htm"); | |
processDocument("resources/robinsoncrusoe.txt"); | |
processDocument("resources/callofthewild.pdf"); | |
private static void processDocument(String pathfilename) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Tokenizing content using OpenNLP | |
//'Whatson' blog series at johnmiedema.com | |
//http://johnmiedema.com/?tag=whatson | |
//select tokenizer model, in this case a pre-trained model from OpenNLP | |
//custom models can be built for unique whitespace handling requirements | |
InputStream modelIn = new FileInputStream("en-token.bin"); | |
try { | |
//load the model |