使用Java插入段落和子段落的级别
我想有一种方法来实现将级别标记为段落、子段落和子句,以下是文本的输入和输出格式
输入文本:
(A) Preparations
(1) Required ingredients to prepare...
(a) 100ml of coconut oil
(b) 2 table spoon of lemon mixed..
(B) Process steps
(i) Mix well the ...
(ii) Apply in all parts of ...
(iii) Gently give a massage..
输出文本:
<Level type="Para" id="(A)">
(A) Preparations
<Level type="Sub-Para" id="(A)(1)">
(1) Required ingredients to prepare...
<Level type="Clause" id="(A)(1)(a)">
(a) 100ml of coconut oil
<Level type="Clause" id="(A)(1)(b)">
(b) 2 table spoon of lemon mixed..
<Level type="Para" id="(B)">
(B) Process steps
<Level type="Sub-Para" id="(B)(i)">
(i) Mix well the ...
<Level type="Sub-Para" id="(B)(ii)">
(ii) Apply in all parts of ...
<Level type="Sub-Para" id="(B)(iii)">
(iii) Gently give a massage..
请协助如何使用Java实现这一点。我自己试试
显示文本对齐只是为了更好地理解级别
如果我在解释问题时不清楚,请让我知道,我会修改问题
谢谢
# 1 楼答案