Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

woncz/Adengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Adengine

part 1

a java implementation of ad retrival algorithm proposed in Indexing Boolean Expressions

part 2

TODO : need to add a implementation of ad retrival algorithm based on searching keywords

QuickStart

  • Requirement: Java8

  • Sample Code

 BEIndexer indexer = new BEIndexer();
 AtomicLong id = new AtomicLong(1);
 Document doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("age ∈ {3} ∧ state ∈ {NY }"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("age ∈ {3} ∧ gender ∈ {F}"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("age ∈ {3} ∧ gender ∈ {M} ∧ state ∉ {CA}"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("state ∈ {CA} ∧ gender ∈ {M}"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("age ∈ {3| 4}"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("state ∉ {CA|NY }"));
 indexer.append(doc);
 doc = new Document(id.getAndAdd(1L), new DNFNotation().denotate("subscription ∈ {30|40|50}∧ state ∈ {NY }"));
 indexer.append(doc);
 
 Query query = new Query(new ConjunctionNotation().denotate("age ∈ {3} ∧ state ∈ {CA} ∧ gender ∈ {M}"));
 Set<Long> result = indexer.retrieve(query);

Reference

About

ad impression engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /