I am trying to create a lexicographically sorted index of words along with their position in a text file. 

With the help of experts in this forum I am able to create a lexicographically sorted index of words. I now need help with storing the position of the lexicographically sorted index of words

this is what i have so far:- 
A text file (sometextfile.txt) containing data as follows:- "This is a sample text file"

```
        private const string filepath = @"d:\sometextfile.txt";
        using (StreamReader sr = File.OpenText(filepath))
        {
            string input;
            //dictionary to store the position of the characters in the file as long and the lexicographically sorted value as string
            var parts = new Dictionary<long,string>();

            while ((input = sr.ReadLine()) != null)
            {
                string[] words = input.Split(' ');
                foreach (var word in words)
                {
                    var sortedSubstrings =
                        Enumerable.Range(0, word.Length)
                            .Select(i => word.Substring(i))
                            .OrderBy(s => s);
               parts.AddRange(<store the position of the character>, sortedSubstrings);

                }
            }
        }

```