mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add a new test case for chapter recognition
This commit is contained in:
		| @@ -12,7 +12,7 @@ public class ChapterRecognition { | ||||
|  | ||||
|     private static Pattern p1 = Pattern.compile("Ch[^0-9]?\\s*(\\d+[\\.,]?\\d*)"); | ||||
|     private static Pattern p2 = Pattern.compile("(\\d+[\\.,]?\\d*)"); | ||||
|     private static Pattern p3 = Pattern.compile("(\\d+[\\.,]?\\d*:)"); | ||||
|     private static Pattern p3 = Pattern.compile("(\\d+[\\.,]?\\d*\\s*:)"); | ||||
|  | ||||
|     public static void parseChapterNumber(Chapter chapter, Manga manga) { | ||||
|         if (chapter.chapter_number != -1) | ||||
| @@ -29,8 +29,6 @@ public class ChapterRecognition { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         name = replaceIrrelevantCharacters(name); | ||||
|  | ||||
|         List<Float> occurences; | ||||
|  | ||||
|         // If there's only one number, use it | ||||
| @@ -49,6 +47,8 @@ public class ChapterRecognition { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         name = replaceIrrelevantCharacters(name); | ||||
|  | ||||
|         // Try to remove the manga name from the chapter, and try again | ||||
|         String mangaName = replaceIrrelevantCharacters(manga.title); | ||||
|         String nameWithoutManga = difference(mangaName, name); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user