这就是我的hibernate.cfg.xml的样子.我的程序正在处理这个问题.我连接到MySQL数据库.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.default_schema">mintaalkalmazas2</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="Kerdes.hbm.xml"/>
<mapping resource="TestTable.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)
这将是persistence.xml.我知道它还没有正确配置.我想连接到同一个MySQL数据库.
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="todos" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>Todo</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306"></property>
<property name="javax.persistence.jdbc.user" value="root" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="database" …Run Code Online (Sandbox Code Playgroud) Damerau-Levenshtein 距离是这样的:
"abcd", "aacd" => 1 DL distance
"abcd", "aadc" => 2 DL distance
Run Code Online (Sandbox Code Playgroud)
我可以在python中使用pyxDamerauLevenshtein modul来确定2个单词的DL距离。我想制作一个生成器方法,它可以在给定的 DL 距离内生成给定关键字参数的每个单词。我只处理 1 或 2 个 DL 距离。
python 中是否有任何工具可以用来生成给定 DL 距离中单词的单词?