import os


def get_true():
    s = set()
    with open("../biliminer/sec.txt", "r") as out:
        for line in out:
            s.add(line.rstrip().lstrip())
    s = list(s)
    for item in s:
        for item2 in s:
            if item != item2 and item in item2:
                print(item + " in: " + item2)
                s.remove(item2)
                continue

    with open("../biliminer/sec_true.txt", "w") as out:
        for item in s:
            out.write(item + "\n")


def print_minus():
    check = set()
    with open("../biliminer/sec.txt", "r") as out:
        for line in out:
            check.add(line.rstrip().lstrip())
    output = set()
    with open("../biliminer/total.txt", "r") as out:
        for line in out:
            output.add(line.rstrip().lstrip())
    for i in check - output:
        print(i)

if __name__ == "__main__":
    with open("../emoticon/input1utf16.txt", "r", encoding="utf-16") as file:
        with open("../emoticon/input1.txt", "w", encoding="utf-8") as i:
            for line in file:
                i.write(line.encode('utf-8').decode('utf-8'))
