From ede1ece0685097848aa7628830fdb3a0016a8d38 Mon Sep 17 00:00:00 2001 From: Giorgos Stamatelatos Date: Thu, 14 Dec 2017 17:25:01 +0200 Subject: [PATCH] Minor README changes --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b0b5c5f..7aeedbd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This library distinguishes these algorithms into two main categories: the ones t Select 10 numbers at random in the range [1,100]. Each number has a 10% probability of appearing in the sample. ```java -final RandomSampling rs = new WatermanSampling<>(10, new Random()); +RandomSampling rs = new WatermanSampling<>(10, new Random()); rs.feed(IntStream.rangeClosed(1, 100).boxed().iterator()); Collection sample = rs.sample(); System.out.println(sample); @@ -18,21 +18,21 @@ System.out.println(sample); Select 5 random tokens from an input stream. ```java -final RandomSampling rs = new VitterXSampling<>(5, new Random()); +RandomSampling rs = new VitterXSampling<>(5, new Random()); rs.feed(new Scanner(System.in)); System.out.println(rs.sample()); ``` Same example using Algorithm Z. ```java -final RandomSampling rs = new VitterZSampling<>(5, new Random()); +RandomSampling rs = new VitterZSampling<>(5, new Random()); rs.feed(new Scanner(System.in)); System.out.println(rs.sample()); ``` Select 2 terms from a vocabulary, based on their weight. ```java -final WeightedRandomSampling rs = new EfraimidisSampling<>(2, new Random()); +WeightedRandomSampling rs = new EfraimidisSampling<>(2, new Random()); rs.feed("collection", 1) .feed("algorithms", 2) .feed("java", 2) @@ -44,10 +44,8 @@ System.out.println(rs.sample()); ## Algorithms -### Summary - | Class | Algorithm | Weighted | -| -------------------- | ----------------------------- | -------- | +| :------------------- | :---------------------------- | :------- | | `WatermanSampling` | Algorithm R by Waterman | | | `VitterXSampling` | Algorithm X by Vitter | | | `VitterZSampling` | Algorithm Z by Vitter | |