adindex4j

a java implementation of ad retrival algorithm proposed in Indexing Boolean Expressions-Ⅱ.pdf

License

License

Categories

Categories

Dex General Purpose Libraries Utility
GroupId

GroupId

com.downgoon
ArtifactId

ArtifactId

adindex4j
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

adindex4j
a java implementation of ad retrival algorithm proposed in Indexing Boolean Expressions-Ⅱ.pdf
Project URL

Project URL

http://github.com/downgoon/adindex4j
Source Code Management

Source Code Management

http://github.com/downgoon/adindex4j

Download adindex4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.downgoon/adindex4j/ -->
<dependency>
    <groupId>com.downgoon</groupId>
    <artifactId>adindex4j</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.downgoon/adindex4j/
implementation 'com.downgoon:adindex4j:0.0.1'
// https://jarcasting.com/artifacts/com.downgoon/adindex4j/
implementation ("com.downgoon:adindex4j:0.0.1")
'com.downgoon:adindex4j:jar:0.0.1'
<dependency org="com.downgoon" name="adindex4j" rev="0.0.1">
  <artifact name="adindex4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.downgoon', module='adindex4j', version='0.0.1')
)
libraryDependencies += "com.downgoon" % "adindex4j" % "0.0.1"
[com.downgoon/adindex4j "0.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.7

provided (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.24

test (2)

Group / Artifact Type Version
junit : junit jar 4.4
org.slf4j : slf4j-simple jar 1.7.24

Project Modules

There are no modules declared in this project.

adindex4j

a java implementation of ad retrival algorithm proposed in Indexing Boolean Expressions-Ⅱ.pdf

QuickStart

  • Requirement: Java8

  • Maven Dependency

<dependency>
  <groupId>com.downgoon</groupId>
  <artifactId>adindex4j</artifactId>
  <version>${version}</version>
</dependency>

the lastest release version can be found here g:"com.downgoon" a:"adindex4j"

  • Sample Code
// 5 ad documents targeting several attributes
AdRetrival adRetrival = new BEScaner();

// notation form targeting: 1, "location=北京^gender=男"
adRetrival.appendDocument(1, "location=北京^gender=男");

// java-object form targeting: 2, "location=上海^gender=女"
adRetrival.appendDocument(new Document(2,
    new DNF( //
        new Conjunction( //
            new Assignment("location", Predicate.INCLUSIVE, "上海"), //
            new Assignment("gender", Predicate.INCLUSIVE, "") //
        ) //
    )));

// a DNF with multiple conjunctions
adRetrival.appendDocument(3, "(location=北京|上海^gender=男) | (location=深圳^gender=女)");
adRetrival.appendDocument(4, "location!=北京|上海");

// query
String query = "location=北京^gender=男";

// results: [1, 3]
Set<Long> docIds = adRetrival.retrieveDocuments(query);
LOG.info("query: {}, results: {}", query, docIds);

Versions

Version
0.0.1