Added Config builder

This commit is contained in:
Erik C. Thauvin 2024-05-11 15:52:31 -07:00
parent 281f43fe1d
commit 962aa6a86c
Signed by: erik
GPG key ID: 776702A6A2DA330E
8 changed files with 174 additions and 10 deletions

View file

@ -15,6 +15,14 @@ public class ReadingTimeSample {
rt.setPostfix("minute to read");
rt.setPlural("minutes to read");
// final Config config =
// new Config.Builder()
// .text(Files.readString(text))
// .postfix("minute to read")
// .plural("minutes to read")
// .build();
// final ReadingTime rt = new ReadingTime(config);
System.out.println("It will take " + rt.calcReadingTime() + ' ' + ReadingTime.wordCount(rt.getText())
+ " words and " + ReadingTime.imgCount(rt.getText()) + " images at " + rt.getWpm()
+ " words per minute.");

View file

@ -12,7 +12,7 @@ repositories {
}
dependencies {
implementation("net.thauvin.erik:readingtime:0.9.2")
implementation("net.thauvin.erik:readingtime:0.9.3-SNAPSHOT")
}
java {

View file

@ -15,6 +15,14 @@ public class ReadingTimeSample {
rt.setPostfix("minute to read");
rt.setPlural("minutes to read");
// final Config config =
// new Config.Builder()
// .text(Files.readString(text))
// .postfix("minute to read")
// .plural("minutes to read")
// .build();
// final ReadingTime rt = new ReadingTime(config);
System.out.println("It will take " + rt.calcReadingTime() + ' ' + ReadingTime.wordCount(rt.getText())
+ " words and " + ReadingTime.imgCount(rt.getText()) + " images at " + rt.getWpm()
+ " words per minute.");