swift - How do I search a large text file (book)? -
i have tried find information in books , many places on net no end. want app book. want add search function in ideal world ibooks search. other thing not clear on put file (book) searched. hope makes things bit more clear.
there nothing built swift programming language it. need create own index book text in order search efficiently. create index first remove stopwords -- words frequent , not supposed have search result "the", "is", etc. (you can find sample list of stopwords here). next step stemming. can read more here. converting words stem in order find them when different derivation of them searched. example when 1 searches run, show results ran too. after create index simple dictionary of . create index traverse processed text (the stemmed text no stopwords), , add every word index. if word present in index, add new occurrence index , if not there, add dictionary.
the above process not need done using swift , might able find programs , add resulting index ios program.
Comments
Post a Comment