Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How is the algorithm to compare a "lot" of strings, tell z frequency and tell which similar strings are found in which index?

How is the algorithm to compare a "lot" of strings, tell z frequency and tell which similar strings are found in which index?

Scheduled Pinned Locked Moved C#
databasealgorithmsdata-structuresjsonquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CoderForEver
    wrote on last edited by
    #1

    I was working on conflation .... and I have 25 text boxes .. I collected this strings on an array ... But It becomes a headache for me to compare the 25 strings , and if there are similar strings I want to know how many different strings are there..... the frequency and in which index they are found ... I couldn't have the idea of the algorithm to do that ... Please just show me the algorithm and I will work out the rest my self ... Thank you

    L A 2 Replies Last reply
    0
    • C CoderForEver

      I was working on conflation .... and I have 25 text boxes .. I collected this strings on an array ... But It becomes a headache for me to compare the 25 strings , and if there are similar strings I want to know how many different strings are there..... the frequency and in which index they are found ... I couldn't have the idea of the algorithm to do that ... Please just show me the algorithm and I will work out the rest my self ... Thank you

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Maybe you should sort them first and then your comparisons will be somewhat easier, as you can find groups without having to do repeated compares.

      C 1 Reply Last reply
      0
      • L Lost User

        Maybe you should sort them first and then your comparisons will be somewhat easier, as you can find groups without having to do repeated compares.

        C Offline
        C Offline
        CoderForEver
        wrote on last edited by
        #3

        Depending on what am going to sort them ? .... is it by name .. or by wat?

        L 1 Reply Last reply
        0
        • C CoderForEver

          Depending on what am going to sort them ? .... is it by name .. or by wat?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          CoderForEver wrote:

          Depending on what am going to sort them ? .... is it by name .. or by wat?

          No idea! It's your data so you are the one who has to decide how you want the information ordered. What are your criteria for similarity and difference?

          C 1 Reply Last reply
          0
          • L Lost User

            CoderForEver wrote:

            Depending on what am going to sort them ? .... is it by name .. or by wat?

            No idea! It's your data so you are the one who has to decide how you want the information ordered. What are your criteria for similarity and difference?

            C Offline
            C Offline
            CoderForEver
            wrote on last edited by
            #5

            the similarity is just checking z words i.e checking the 25 strings ... if string1 and string 2 are the same then string 2 and 3 and soon

            L 1 Reply Last reply
            0
            • C CoderForEver

              the similarity is just checking z words i.e checking the 25 strings ... if string1 and string 2 are the same then string 2 and 3 and soon

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              CoderForEver wrote:

              the similarity is just checking z words

              Then I guess you sort on that ...

              1 Reply Last reply
              0
              • C CoderForEver

                I was working on conflation .... and I have 25 text boxes .. I collected this strings on an array ... But It becomes a headache for me to compare the 25 strings , and if there are similar strings I want to know how many different strings are there..... the frequency and in which index they are found ... I couldn't have the idea of the algorithm to do that ... Please just show me the algorithm and I will work out the rest my self ... Thank you

                A Offline
                A Offline
                Alan Balkany
                wrote on last edited by
                #7

                Using a NameValueCollection will do the sorting for you. If the string isn't in the collection, insert it with a count of 1. If it IS there, increment the count. The collection will instantly tell you how many different strings there are with the Count member.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups