コード例 #1
0
def pve(arg):
    player1, board1 = f.parse(arg)
    board1 = fh.deserialize(player1, board1)
    Pve_loop.bot = ff.Bot_player()
    board2 = Pve_loop.bot.board
    Pve_loop.game = ff.Game(board1, board2, False)
    Pve_loop.players = [player1, "pc"]
コード例 #2
0
    def search(self, query):
        expanded_inv_idx = {}
        filtered_documents = []

        # Binary AND search for quoted phrases and NOT search for negated words
        self._binary_search(query.quoted_phrases, query.negated_words, expanded_inv_idx, 
            filtered_documents)

        # TODO: busca ranqueada do passo anterior
        ranked_documents = self._compute_scores(query.unquoted_words, 
            expanded_inv_idx, filtered_documents)

        doc_number = 1
        return [deserialize(str(doc_id)+'.dbf') for doc_id in ranked_documents]
コード例 #3
0
    def search(self, query):
        expanded_inv_idx = {}
        filtered_documents = []

        # Binary AND search for quoted phrases and NOT search for negated words
        self._binary_search(query.quoted_phrases, query.negated_words,
                            expanded_inv_idx, filtered_documents)

        # TODO: busca ranqueada do passo anterior
        ranked_documents = self._compute_scores(query.unquoted_words,
                                                expanded_inv_idx,
                                                filtered_documents)

        doc_number = 1
        return [
            deserialize(str(doc_id) + '.dbf') for doc_id in ranked_documents
        ]
コード例 #4
0
 def __init__(self):
     self.inverted_index = deserialize(PATH+'inverted_index.idx')
コード例 #5
0
 def __init__(self):
     self.inverted_index = deserialize(PATH + 'inverted_index.idx')
コード例 #6
0
def pvp(arg):
    player1, board1, player2, board2 = f.parse(arg)
    board1 = fh.deserialize(player1, board1)
    board2 = fh.deserialize(player2, board2)
    Pvp_loop.game = ff.Game(board1, board2, True)
    Pvp_loop.players = [player1, player2]
コード例 #7
0
 def start(self):
     name = "pc"
     boards = fh.player_boards(name)
     board = boards[random.randint(0, len(boards) - 1)]
     self.board = fh.deserialize(name, board)