All Downloads are FREE. Search and download functionalities are using the official Maven repository.

angry1980.audio.fingerprint.InvertedIndex Maven / Gradle / Ivy

There is a newer version: 0.0.10
Show newest version
package angry1980.audio.fingerprint;

import angry1980.audio.model.Fingerprint;
import angry1980.audio.model.ImmutableTrackSimilarity;
import angry1980.audio.model.TrackSimilarity;

import java.util.stream.Stream;

public interface InvertedIndex {

    static TrackSimilarity reduceTrackSimilarity(Fingerprint f, long track2, Stream data){
        return data.reduce(
                (TrackSimilarity) ImmutableTrackSimilarity.builder()
                        .track1(f.getTrackId())
                        .track2(track2)
                        .fingerprintType(f.getType())
                        .build(),
                (ts, th) -> ts.add(th.intValue()),
                TrackSimilarity::add
        );
    }

    F save(F fingerprint);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy