1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| package com.xindao.ocr.smartjavaai.enums;
|
| /**
| * OCR表格结构模型枚举
| * @author dwj
| */
| public enum TableStructureModelEnum {
|
| SLANET,
| //SLANEXT_WIRED,
| SLANET_PLUS;
|
|
|
|
| /**
| * 根据名称获取枚举 (忽略大小写和下划线变体)
| */
| public static TableStructureModelEnum fromName(String name) {
| String formatted = name.trim().toUpperCase().replaceAll("[-_]", "");
| for (TableStructureModelEnum model : values()) {
| if (model.name().replaceAll("_", "").equals(formatted)) {
| return model;
| }
| }
| throw new IllegalArgumentException("未知模型名称: " + name);
| }
|
|
| }
|
|