Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search_Engine: Update unit tests for ExtractAll, ExtractTop, ExtractSorted and MatchScore #3377

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Datasets/Search_Engine/Compute/ExtractAll.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .ci/Datasets/Search_Engine/Compute/ExtractSorted.json
Original file line number Diff line number Diff line change
@@ -0 +0,0 @@
{ "_t" : "BH.oM.Data.Library.Dataset", "SourceInformation" : { "_t" : "BH.oM.Data.Library.Source", "SourceLink" : "https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/BHoM/AGS_Toolkit/%232-FuzzyMatching.gh?csf=1&web=1&e=PzDCfb", "Title" : "ExtractSorted", "Author" : "Peter Nugent", "ItemReference" : "", "Version" : "", "Publisher" : "", "Schema" : "", "Language" : "", "Location" : "", "Copyright" : "", "Contributors" : "", "Confidence" : "Medium", "BHoM_Guid" : "e1a3e3e8-5c1b-45be-a7f8-e651c9938484" }, "TimeOfCreation" : { "$date" : 1706261026721 }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.UnitTest", "Method" : { "_t" : "System.Reflection.MethodBase", "TypeName" : "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.Engine.Search.Compute, Search_Engine, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null\", \"_bhomVersion\" : \"7.1\" }", "MethodName" : "ExtractSorted", "Parameters" : ["{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.1\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"System.Collections.Generic.IEnumerable`1, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"GenericArguments\" : [{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.1\" }], \"_bhomVersion\" : \"7.1\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.oM.Search.Scorer\", \"_bhomVersion\" : \"7.1\" }"], "_bhomVersion" : "7.1" }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.TestData", "Inputs" : ["Chalk", { "_t" : "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "_v" : ["White Chalk", "Chalk - White", "Clay", "London Clay", "Portland Cement", "Absestos", "Clay London Soft"] }, { "_t" : "System.Enum", "TypeName" : { "_t" : "System.Type", "Name" : "BH.oM.Search.Scorer", "_bhomVersion" : "7.1" }, "Value" : "DefaultRatio" }], "Outputs" : [{ "_t" : "System.Collections.Generic.List`1[[BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Search_oM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "_v" : [{ "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "White Chalk", "Score" : 62.0, "Index" : 0 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Chalk - White", "Score" : 56.0, "Index" : 1 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Clay", "Score" : 44.0, "Index" : 2 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "London Clay", "Score" : 25.0, "Index" : 3 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Clay London Soft", "Score" : 19.0, "Index" : 6 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Portland Cement", "Score" : 10.0, "Index" : 4 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Absestos", "Score" : 0.0, "Index" : 5 }] }], "BHoM_Guid" : "6c195eed-0a79-41aa-a95d-1069d9d36a89" }], "BHoM_Guid" : "ea39cb8e-6a63-4889-a002-4f6864bc788c" }, { "_t" : "BH.oM.Test.UnitTests.UnitTest", "Method" : { "_t" : "System.Reflection.MethodBase", "TypeName" : "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.Engine.Search.Compute, Search_Engine, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null\", \"_bhomVersion\" : \"7.1\" }", "MethodName" : "ExtractSorted", "Parameters" : ["{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.1\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"System.Collections.Generic.List`1, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"GenericArguments\" : [{ \"_t\" : \"System.Type\", \"Name\" : \"BH.oM.Base.BHoMObject\", \"_bhomVersion\" : \"7.1\" }], \"_bhomVersion\" : \"7.1\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.1\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.oM.Search.Scorer\", \"_bhomVersion\" : \"7.1\" }"], "_bhomVersion" : "7.1" }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.TestData", "Inputs" : ["23", { "_t" : "System.Collections.Generic.List`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "_v" : [{ "name" : "23", "cost" : "4", "BHoM_Guid" : "ead24c9d-d62e-4503-adfb-f39d8ae56b8e" }, { "name" : "BH23", "cost" : "4", "BHoM_Guid" : "55fa9a03-2475-490f-b6b3-1a734a290ad6" }, { "name" : "twenty three", "cost" : "65", "BHoM_Guid" : "2790c476-642e-4293-ade3-b9e7b9a22924" }, { "name" : "24", "cost" : "76", "BHoM_Guid" : "d56dd0fd-77a7-45ad-8f88-5a429dd3d1e5" }, { "name" : "twenty 3", "cost" : "3", "BHoM_Guid" : "a7e767c4-4c22-48bd-8166-8287abdd6648" }, { "name" : "five", "cost" : "5476", "BHoM_Guid" : "b7a3f29b-3d0b-4d7f-9ade-388b062bf98d" }, { "name" : "six", "cost" : "84", "BHoM_Guid" : "5f0376f5-d9eb-4f80-9e99-6c3402e1159f" }, { "name" : "7", "cost" : "75", "BHoM_Guid" : "dca3c590-2869-4e1e-a16d-f6d8aeb40ed8" }, { "name" : "aight", "cost" : "74", "BHoM_Guid" : "f6eda5c2-4d17-434f-bc00-3cfa569987a3" }] }, "name", { "_t" : "System.Enum", "TypeName" : { "_t" : "System.Type", "Name" : "BH.oM.Search.Scorer", "_bhomVersion" : "7.1" }, "Value" : "DefaultRatio" }], "Outputs" : [{ "_t" : "System.Collections.Generic.List`1[[BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]], Search_oM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "_v" : [{ "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "23", "cost" : "4", "BHoM_Guid" : "ead24c9d-d62e-4503-adfb-f39d8ae56b8e" }, "Score" : 100.0, "Index" : 0 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "BH23", "cost" : "4", "BHoM_Guid" : "55fa9a03-2475-490f-b6b3-1a734a290ad6" }, "Score" : 67.0, "Index" : 1 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "24", "cost" : "76", "BHoM_Guid" : "d56dd0fd-77a7-45ad-8f88-5a429dd3d1e5" }, "Score" : 50.0, "Index" : 3 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "twenty 3", "cost" : "3", "BHoM_Guid" : "a7e767c4-4c22-48bd-8166-8287abdd6648" }, "Score" : 20.0, "Index" : 4 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "twenty three", "cost" : "65", "BHoM_Guid" : "2790c476-642e-4293-ade3-b9e7b9a22924" }, "Score" : 0.0, "Index" : 2 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "five", "cost" : "5476", "BHoM_Guid" : "b7a3f29b-3d0b-4d7f-9ade-388b062bf98d" }, "Score" : 0.0, "Index" : 5 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "six", "cost" : "84", "BHoM_Guid" : "5f0376f5-d9eb-4f80-9e99-6c3402e1159f" }, "Score" : 0.0, "Index" : 6 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "7", "cost" : "75", "BHoM_Guid" : "dca3c590-2869-4e1e-a16d-f6d8aeb40ed8" }, "Score" : 0.0, "Index" : 7 }, { "_t" : "BH.oM.Search.SearchResult`1[[BH.oM.Base.BHoMObject, BHoM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "Result" : { "name" : "aight", "cost" : "74", "BHoM_Guid" : "f6eda5c2-4d17-434f-bc00-3cfa569987a3" }, "Score" : 0.0, "Index" : 8 }] }], "BHoM_Guid" : "62fa9bb8-d759-4693-b2ab-9bf6f890040e" }], "BHoM_Guid" : "0d3c5e7e-b9e4-419d-b035-f4e68fd19f00" }], "BHoM_Guid" : "87a948fa-838f-4184-9d36-688938a787b5", "Name" : "ExtractSorted", "_bhomVersion" : "7.1" }
Expand Up @@ -2,0 +1 @@
{ "_t" : "BH.oM.Data.Library.Dataset", "SourceInformation" : { "_t" : "BH.oM.Data.Library.Source", "SourceLink" : "https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/BHoM/AGS_Toolkit/%232-FuzzyMatching.gh?csf=1&web=1&e=PzDCfb", "Title" : "ExtractSorted", "Author" : "Peter Nugent", "ItemReference" : "", "Version" : "", "Publisher" : "", "Schema" : "", "Language" : "", "Location" : "", "Copyright" : "", "Contributors" : "", "Confidence" : "Medium", "BHoM_Guid" : "dc74951f-8cb9-45d5-88c4-78396bdf7ace", "Name" : "" }, "TimeOfCreation" : { "$date" : 1720780864630 }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.UnitTest", "Method" : { "_t" : "System.Reflection.MethodBase", "TypeName" : "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.Engine.Search.Compute, Search_Engine, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null\", \"_bhomVersion\" : \"7.3\" }", "MethodName" : "ExtractSorted", "Parameters" : ["{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.3\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"System.Collections.Generic.IEnumerable`1, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"GenericArguments\" : [{ \"_t\" : \"System.Type\", \"Name\" : \"System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\", \"_bhomVersion\" : \"7.3\" }], \"_bhomVersion\" : \"7.3\" }", "{ \"_t\" : \"System.Type\", \"Name\" : \"BH.oM.Search.Scorer\", \"_bhomVersion\" : \"7.3\" }"], "_bhomVersion" : "7.3" }, "Data" : [{ "_t" : "BH.oM.Test.UnitTests.TestData", "Inputs" : ["Chalk", { "_t" : "System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "_v" : ["White Chalk", "Chalk - White", "Clay", "London Clay", "Portland Cement", "Absestos", "Clay London Soft"] }, { "_t" : "System.Enum", "TypeName" : { "_t" : "System.Type", "Name" : "BH.oM.Search.Scorer", "_bhomVersion" : "7.3" }, "Value" : "DefaultRatio" }], "Outputs" : [{ "_t" : "System.Collections.Generic.List`1[[BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Search_oM, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]]", "_v" : [{ "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "White Chalk", "Score" : 62.0, "Index" : 0 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Chalk - White", "Score" : 56.0, "Index" : 1 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Clay", "Score" : 44.0, "Index" : 2 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "London Clay", "Score" : 25.0, "Index" : 3 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Clay London Soft", "Score" : 19.0, "Index" : 6 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Portland Cement", "Score" : 10.0, "Index" : 4 }, { "_t" : "BH.oM.Search.SearchResult`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", "Result" : "Absestos", "Score" : 0.0, "Index" : 5 }] }], "BHoM_Guid" : "63a16634-e9f9-4b4a-84d8-313cd36ed53d", "Name" : "" }], "BHoM_Guid" : "8843cbce-204f-417e-8af3-e1fdb8d00b43", "Name" : "" }], "BHoM_Guid" : "102faa66-dcfb-4f19-86ff-dc8664a58328", "Name" : "ExtractSorted", "_bhomVersion" : "7.3" }

Check notice on line 1 in .ci/Datasets/Search_Engine/Compute/ExtractSorted.json

View check run for this annotation

BHoMBot-CI / dataset-compliance

.ci/Datasets/Search_Engine/Compute/ExtractSorted.json#L1

Title: ExtractSorted Author: Peter Nugent Confidence: Medium Version: Source Link: https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/BHoM/AGS_Toolkit/%232-FuzzyMatching.gh?csf=1&web=1&e=PzDCfb Publisher: Language: Schema: Location: Copyright: Contributors: Item Reference:
2 changes: 1 addition & 1 deletion .ci/Datasets/Search_Engine/Compute/ExtractTop.json

Large diffs are not rendered by default.

Loading
Loading