This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fulton
committed
Feb 24, 2020
1 parent
b788559
commit 92816da
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
package com.andromeda.araserver.test | ||
|
||
import com.andromeda.araserver.pages.ApiStart | ||
import com.andromeda.araserver.skills.Weather | ||
import com.andromeda.araserver.util.KeyWord | ||
import opennlp.tools.parser.ParserFactory | ||
import opennlp.tools.parser.ParserModel | ||
import org.junit.Test | ||
import java.net.URL | ||
|
||
class WeatherTest { | ||
@Test | ||
fun test(){ | ||
val weather = Weather() | ||
val apiStart = ApiStart() | ||
val classloader = javaClass.classLoader | ||
var `is` = classloader.getResourceAsStream("resources/parse.bin") | ||
println("test") | ||
if (`is` == null) { | ||
val url = | ||
URL("https://arafilestore.file.core.windows.net/ara-server-files/parse.bin?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2024-04-01T22:11:11Z&st=2019-12-19T15:11:11Z&spr=https&sig=lfjMHSahA6fw8enCbx0hFTE1uAVJWvPmC4m6blVSuuo%3D") | ||
`is` = url.openStream() | ||
} | ||
val model = ParserModel(`is`) | ||
val parser = ParserFactory.create(model) | ||
val keyWord = KeyWord(`is`!!) | ||
weather.mainPart("/weather in portland oregon tomorrow&log=0.0=lat=0.0", keyWord, parser) | ||
} | ||
} |