C# 클래스 subtitleMemorize.SubtitleMatcher

파일 보기 프로젝트 열기: ChangSpivey/SubtitleMemorize 1 사용 예제들

공개 메소드들

메소드 설명
GetParameterCache ( List lines1, List lines2 ) : SubtitleMatcherCache
MatchSubtitles ( SubtitleMatcherCache cache ) : LinkedList

Matches the two subtitles. The problem is that no two subtiles have the same timestamps or the same number of lines (they can be split, omitted, ...). This algotithm tries to find matching lines nontheless. The general algorithm works as following: Compare every "line1" in list1 with every "line2" in list2. Generate a score (between 0 and 1) how good they overlap. If the score is above a certain threshold, there will be an edge (as in graph theory) beween line1 and line2. There result is a bipartite graph that has many connected compontens. Every connected component is then a mached line. There is another step that removes matchings where two lines in same list overlap. See documentation of "RemoveOverlappings()" for more information.

비공개 메소드들

메소드 설명
FindBidirectionalMapping ( List mappingForLines1, List mappingForLines2 ) : LinkedList
FindMatching ( List list1, List list2 ) : void

This creates a list of good matching lines between primaryList and secondaryList.

GetLeastFittingLine ( LineInfo lineInfo, LinkedList matchingLines ) : ExtendedLineInfo

Returns the line from "matching lines" that has the least overlapping rating with "lineInfo".

RemoveOverlappings ( List primaryList ) : void

Removes the overlappings in one list. Example: sub1 is in list1 sub2 and sub3 are in list2 sub1 overlaps with sub2, sub3 + sub2 and sub3 overlap An example of this in the real worlds are announcements while the main characters are speaking. We obviously only want to map the character-dialog and the announcement to its own translation.

메소드 상세

GetParameterCache() 공개 정적인 메소드

public static GetParameterCache ( List lines1, List lines2 ) : SubtitleMatcherCache
lines1 List
lines2 List
리턴 SubtitleMatcherCache

MatchSubtitles() 공개 정적인 메소드

Matches the two subtitles. The problem is that no two subtiles have the same timestamps or the same number of lines (they can be split, omitted, ...). This algotithm tries to find matching lines nontheless. The general algorithm works as following: Compare every "line1" in list1 with every "line2" in list2. Generate a score (between 0 and 1) how good they overlap. If the score is above a certain threshold, there will be an edge (as in graph theory) beween line1 and line2. There result is a bipartite graph that has many connected compontens. Every connected component is then a mached line. There is another step that removes matchings where two lines in same list overlap. See documentation of "RemoveOverlappings()" for more information.
public static MatchSubtitles ( SubtitleMatcherCache cache ) : LinkedList
cache SubtitleMatcherCache
리턴 LinkedList