Skip to content

Commit fa86fe9

Browse files
committed
Add some
1 parent fe69129 commit fa86fe9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/org/bitlap/geocoding/Geocoding.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ object Geocoding {
6565
/**
6666
* 深度优先匹配符合[text]的地址信息
6767
*/
68+
@JvmStatic
6869
fun match(text: String): List<RegionEntity> {
6970
return DEFAULT.match(text)
7071
}

src/main/java/org/bitlap/geocoding/GeocodingX.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ open class GeocodingX(val ctx: Context) {
9090
* @param alias 地址的别名
9191
* @param replace 是否替换旧地址, 当除了[id]之外的字段, 如果相等就替换
9292
*/
93-
fun addRegionEntry(id: Long, parentId: Long, name: String, type: RegionType = RegionType.Undefined, alias: String = "", replace: Boolean = true) {
93+
fun addRegionEntry(id: Long, parentId: Long, name: String, type: RegionType = RegionType.Undefined, alias: String = "", replace: Boolean = true): GeocodingX {
9494
ctx.persister.getRegion(parentId) ?: throw IllegalArgumentException("Parent Address is not exists, parentId is $parentId")
9595
if (name.isBlank()) {
9696
throw IllegalArgumentException("name should not be blank.")
@@ -107,5 +107,6 @@ open class GeocodingX(val ctx: Context) {
107107
// 2. Build term index
108108
val indexBuilder = ctx.interpreter.getTermIndexBuilder()
109109
indexBuilder.indexRegions(listOf(region), replace)
110+
return this
110111
}
111112
}

0 commit comments

Comments
 (0)