aboutsummaryrefslogtreecommitdiffstats
path: root/tf_idf.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-11-24 16:31:46 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2021-11-24 16:31:46 +0000
commit5e4aee62e7a746491edd9077c0bdd959c444960b (patch)
tree09dd0d3bdbfdb1a5dc5c84b86c0088c9082a7842 /tf_idf.py
parentcb4be28b07823639a64afaa34bf3919220a81e12 (diff)
downloadsearchEngine-5e4aee62e7a746491edd9077c0bdd959c444960b.tar.gz
searchEngine-5e4aee62e7a746491edd9077c0bdd959c444960b.zip
added a simple search system
Diffstat (limited to 'tf_idf.py')
-rw-r--r--tf_idf.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/tf_idf.py b/tf_idf.py
index 615720d..883f236 100644
--- a/tf_idf.py
+++ b/tf_idf.py
@@ -1,17 +1,17 @@
-import math as maths
-import database
-
-def main():
- with database.Database() as db:
- db.build_tf_idf_table()
-
- db.get_tf_idf_table()
-
-def calc_log_tf(tf):
- if tf == 0:
- return 0
- else:
- return maths.log10(1 + tf)
-
-if __name__ == "__main__":
+import math as maths
+import database
+
+def main():
+ with database.Database() as db:
+ db.build_tf_idf_table()
+
+ db.get_tf_idf_table()
+
+def calc_log_tf(tf):
+ if tf == 0:
+ return 0
+ else:
+ return maths.log10(1 + tf)
+
+if __name__ == "__main__":
main() \ No newline at end of file