Skip to content

Instantly share code, notes, and snippets.

List<Span> spanList = Arrays.asList(spans);
for (int i = 0; i < spanList.size(); i++) {
Span a = spanList.get(i);
for (int c = i + 1; c < spanList.size(); c++) {
Span b = spanList.get(c);
if (a.contains(b)) {
package ner.extractor;
import java.util.Collection;
import opennlp.tools.util.Span;
import java.util.HashSet;
import parsercv.Extractor;
import parsercv.Setup;
import util.Search;
package model;
import java.util.Collection;
import java.util.regex.Pattern;
import opennlp.tools.util.Span;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import opennlp.namefind.RegexNameFinder;
private TreeMap unserializeTreeMap(String fileName) {
TreeMap map = new TreeMap<>();
if (Parser.class.getResourceAsStream("/resource/serialized/" + fileName) != null) {
try (InputStream in = Parser.class.getResourceAsStream("/resource/serialized/" + fileName);
ObjectInputStream ois = new ObjectInputStream(in)) {
map = (TreeMap) ois.readObject();
<?php
public function findTags(Query $query, array $options)
{
// Se non c'è alcuna associazione restituisco la query senza procedere
if (empty($options['association'])) {
return $query;
}
if (empty($options['matching'])) {
// Contain
} else {
// Matching
$associationConditions = $this->association($options['association'])->conditions();
return $query
->join([
'table' => 'tags_associations',
'alias' => $options['association'],
'type' => 'INNER',
'conditions' => [
$(document).ready(function () {
var selectizeOptions = {
maxItems: null,
delimiter: ',',
preload: true,
valueField: 'id',
labelField: 'tag_name',
searchField: 'tag_name',
options: [],
create: function (input) {
/**
* Richiesta ajax per ricerca Tags
*
* Parametri:
* - scope: intero o array di interi che indica lo scope dei tags desiderati
* - query: digitazione dell'utente
*
* @return type
*/
public function getDataAjax()
/**
* Callback Auth isAuthorized
*
* @param type $user
* @return boolean
*/
public function isAuthorized($user = null)
{
parent::isAuthorized($user);
<?php
namespace App\Controller;
use App\Controller\AppController;
use Cake\ORM\TableRegistry;
use Cake\Routing\Router;
/**
* Tags Controller
*