def xassociate(title)
if entry = @entries[title]
if entry.associated?
raise AlreadyAssociatedError, "Cannot associate an already associated title (#{title.inspect})"
else
entry.associated = true
id = entry.id
end
elsif (moved_entry = find_moved(title)) || (similar_entry = find_similar(title))
if moved_entry
puts "moved entry: #{title.inspect} -> #{moved_entry.title.inspect}"
elsif similar_entry
puts "similar entry: #{title.inspect} -> #{similar_entry.title.inspect}"
end
entry = (moved_entry || similar_entry)
@entries.delete(entry.title)
@entries[title] = entry
entry.title = title
entry.associated = true
entry.fuzzy = true if similar_entry
id = entry.id
else
id = create_unique_id(title)
add(title, id, false, true)
end
return id
end