You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/05/31 22:03:17 UTC

[incubator-nlpcraft] branch master updated: Documentation & code cleanup on examples.

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ca3ef0  Documentation & code cleanup on examples.
6ca3ef0 is described below

commit 6ca3ef0f594b564ac0e80ff2d120aa4df64cabba
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Sun May 31 15:03:05 2020 -0700

    Documentation & code cleanup on examples.
---
 .../apache/nlpcraft/examples/weather/WeatherModel.java    | 15 ++++++++++-----
 .../nlpcraft/examples/weather/WeatherResultWrapper.java   |  1 -
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java b/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
index a410b73..50c256b 100644
--- a/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
+++ b/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
@@ -43,7 +43,6 @@ import static java.time.temporal.ChronoUnit.DAYS;
  *
  * @see WeatherTest
  */
-@SuppressWarnings("Duplicates")
 public class WeatherModel extends NCModelFileAdapter {
     // Please register your own account at https://darksky.net/dev/docs/libraries and
     // replace this demo token with your own.
@@ -57,9 +56,12 @@ public class WeatherModel extends NCModelFileAdapter {
     // Keywords for 'local' weather.
     private static final Set<String> LOCAL_WORDS = new HashSet<>(Arrays.asList("my", "local", "hometown"));
 
+    /**
+     * Date range holder.
+     */
     private static class DateRange {
-        private Instant from;
-        private Instant to;
+        private final Instant from;
+        private final Instant to;
 
         DateRange(Instant from, Instant to) {
             this.from = from;
@@ -67,9 +69,12 @@ public class WeatherModel extends NCModelFileAdapter {
         }
     }
 
+    /**
+     * Coordinates holder.
+     */
     private static class Coordinate {
-        private double latitude;
-        private double longitude;
+        private final double latitude;
+        private final double longitude;
 
         Coordinate(double latitude, double longitude) {
             this.latitude = latitude;
diff --git a/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherResultWrapper.java b/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherResultWrapper.java
index f02e36d..f21010a 100644
--- a/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherResultWrapper.java
+++ b/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherResultWrapper.java
@@ -19,7 +19,6 @@ package org.apache.nlpcraft.examples.weather;
 
 /**
  * Weather result wrapper for JSON formatting.
- *
  */
 public class WeatherResultWrapper {
     private final String intentId;