diff options
author | Arne Juul <arnej@yahooinc.com> | 2023-11-30 13:48:01 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2023-12-11 08:47:15 +0000 |
commit | 055b84652f6a0c9b517c76588c145d92216f6e02 (patch) | |
tree | 635c1763de83261409293d6ae9edb8fc03e9a51d /document/src/main | |
parent | 18e3fb5c91e9e40d46fccc1b8988c445f27ec19e (diff) |
add parsing of special strings for inf/nan cell values
Diffstat (limited to 'document/src/main')
-rw-r--r-- | document/src/main/java/com/yahoo/document/json/readers/TensorReader.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java b/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java index e487fd2ec57..0b7b1ae9996 100644 --- a/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java +++ b/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java @@ -14,6 +14,7 @@ import com.yahoo.tensor.TensorType; import static com.yahoo.document.json.readers.JsonParserHelpers.*; import static com.yahoo.tensor.serialization.JsonFormat.decodeHexString; +import static com.yahoo.tensor.serialization.JsonFormat.decodeNumberString; /** * Reads the tensor format defined at @@ -243,6 +244,9 @@ public class TensorReader { private static double readDouble(TokenBuffer buffer) { try { + if (buffer.current() == JsonToken.VALUE_STRING) { + return decodeNumberString(buffer.currentText()); + } return Double.parseDouble(buffer.currentText()); } catch (NumberFormatException e) { |