我从PDF文档中提取了文本。我想使用Java提取其中的一些特定字段。
文本部分如下:
US00RE44697E (i9) United States (12) Reissued Patent (10) Patent Number: RE44,697 E Jones et al. (45) Date of ReissuedPatent: Jan. 7, 2014 (54) ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT (75) Inventors: David E.Jones, Ottawa (CA); Cormac M.O'Connell, Carp (CA) (73) Assignee: Mosaid Technologies Incorporated, Ottawa, Ontario (CA) (21) Appl.No.: 13/603,137 (22) Filed: Sep. 4, 2012 Related U.S. Patent Documents Reissue of: (64) Patent No.: Issued: Appl. No.: Filed: 6,088,800 Jul. 11, 2000 09/032,029 Feb. 27, 1998 (51) Int.CI. G06F 21/00 (2013.01) (52) U.S. CI. USPC .............713/189; 713/190; 713/193; 380/28; 380/33; 380/52 (58) Field of Classification Search None 现在我的任务是从中提取字段并将其赋值给字符串,即:
文本`(10) Patent Number: RE44,697 E`将被提取为`String pat_no= " RE44,697 E"`。
文本`(54)ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT`将被提取为`String title= "ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT"`。
极不规则的文本块:
(64) Patent No.: Issued: Appl. No.: Filed: 6,088,800 Jul. 11, 2000 09/032,029 Feb. 27, 1998
必须被提取为:
文本部分如下:
US00RE44697E (i9) United States (12) Reissued Patent (10) Patent Number: RE44,697 E Jones et al. (45) Date of ReissuedPatent: Jan. 7, 2014 (54) ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT (75) Inventors: David E.Jones, Ottawa (CA); Cormac M.O'Connell, Carp (CA) (73) Assignee: Mosaid Technologies Incorporated, Ottawa, Ontario (CA) (21) Appl.No.: 13/603,137 (22) Filed: Sep. 4, 2012 Related U.S. Patent Documents Reissue of: (64) Patent No.: Issued: Appl. No.: Filed: 6,088,800 Jul. 11, 2000 09/032,029 Feb. 27, 1998 (51) Int.CI. G06F 21/00 (2013.01) (52) U.S. CI. USPC .............713/189; 713/190; 713/193; 380/28; 380/33; 380/52 (58) Field of Classification Search None 现在我的任务是从中提取字段并将其赋值给字符串,即:
文本`(10) Patent Number: RE44,697 E`将被提取为`String pat_no= " RE44,697 E"`。
文本`(54)ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT`将被提取为`String title= "ENCRYPTIONPROCESSORWITH SHARED MEMORY INTERCONNECT"`。
极不规则的文本块:
(64) Patent No.: Issued: Appl. No.: Filed: 6,088,800 Jul. 11, 2000 09/032,029 Feb. 27, 1998
必须被提取为:
String pat_no_org = "6,088,800";
String issued = "jul.11,2000"
String filed = "feb 27 ,1998"
......
像这样..
我的工作
首先我使用了string.split,string.substring,string.indexof甚至apache string utils,但都没有帮助..因为文本是分散的,上面的方法都没有帮助..我也尝试过正则表达式,但由于我对它非常薄弱,我无法编程。请告诉我如何使用java实现我的目标?